diff --git a/app/models/product_decorator.rb b/app/models/product_decorator.rb index 48b325d..2365542 100644 --- a/app/models/product_decorator.rb +++ b/app/models/product_decorator.rb @@ -1,6 +1,6 @@ Product.class_eval do def self.find_by_array_of_ids(ids) - products = Product.find(:all, :conditions => ["id IN (?)", ids]) + products = Product.where("id IN (?)", ids) ids.map{|id| products.detect{|p| p.id == id.to_i}}.compact end -end \ No newline at end of file +end