I have several named scopes in my app. Some patterns are
used commonly. For example:
Article.published_in(publication).published.viewable_by(current_user).included_in_index
Since this pattern is repeated, I'd like to be able to have a
named_scope that embeds this pattern.
I've tried defining a named_scope in terms of several changed
named_scopes but that doesn't work.
Is there a way to do this? Something like:
named_scope :permitted, :lambda {|user, publication|
published_in(publication).published.viewable_by(user).included_in_index }
I supposed a class method would be the natural alternative, but am
curious if there is indeed a way
to compose named_scopes.
Cheers, --Kip
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---