Created
June 20, 2010 12:57
-
-
Save pmoran/445817 to your computer and use it in GitHub Desktop.
This file contains 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
class CompositeSpecification < Array | |
def all | |
self.inject(Product.scoped(nil)) do |combined_scope, specification| | |
combined_scope.scoped(specification.criteria) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment