Last active
August 29, 2015 14:27
-
-
Save errakeshpd/83c6fc29f22fe73251d4 to your computer and use it in GitHub Desktop.
How can specify this ruby code in the lambda section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How can specify this ".sort_by{ |o| o.reviews.sum(:rating) }" in the lambda section | |
scope :sort_by_recommended, lambda{ } | |
Just like this : | |
scope :sort_by_recommended, lambda{ .sort_by{ |o| o.reviews.sum(:rating) } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment