Can you run a find on an existing hash?

In the Enumerable's find_all method will be:

@products.find_all { |product| product.category_id = 2 }

This method returns an array, the find method returns only the first match. This approach is not the best if you have a lot of products, in that case you will use the ActiveRecord's find and let the database do this work in a more efficient way.


Franco Catena.