removed extra map operation on result
removed extra map operation on result

```ids.map { |id| products.detect { |product| product.id == id.to_i } }.compact``` is resulting same result of ```products = Spree::Product.where('id IN (?)', ids)```.

Modified query to rails syntax
No need to assign to new variable products

spree-contrib/spree_recently_viewed,spree-contrib/spree_recently_viewed,spree-contrib/spree_recently_viewed