I get a resultset from a Rails find query. I want to iterate over that resultset and depending on certain criteria drop records from that resultset before passing it on for further processing. The additional criteria are external to the data held in the database and hence I can't include them in the original 'find' query.
Note I don't want to delete any records from the database just remove them from the resultset.
Please can someone give me the code to do that.
Use reject as in
Model.find_all_by_xxx().reject { |r| r.something? }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With