Skip to content

Instantly share code, notes, and snippets.

@pmoran
Created Jun 20, 2010
Embed
What would you like to do?
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