You could always use Enumeable#select which takes a block and returns only the elements that the block returns true
for. You'd want to make sure that you had ActiveRecord retrieve the result set first (by calling to_a
on your query).
records = Model.where(some_attribute: value).to_a
filtered_records = records.select { |record| record.something? }
Depending on your result set and your needs, it is possible that a second database query would be faster, as your SQL store is better suited to do these comparisons than Ruby. But if your records have yet to be saved, you would need to do something like the above, since the records aren't persisted yet