I think it would be great if named scopes had a bang (!) variation which applies to the current scope instead of returning a new scope. This is very useful if you need to apply scopes conditionally like this: topics = Topic.approved topics.replied! if only_show_replied? topics.scoped! :limit => limit if limit I would love to get some feedback on this. Would you like to see the same thing? You can find the patch here: http://rails.lighthouseapp.com/projects/8994/tickets/368 Ryan
on 2008-06-10 17:01
on 2008-06-10 21:40
On Jun 10, 9:59 am, Ryan Bates <bates.r...@gmail.com> wrote: > I think it would be great if named scopes had a bang (!) variation > which applies to the current scope instead of returning a new scope. I haven't tested this, so I can't exactly give it the old +1, but I expect it to come in handy in the future and it seems like a natural fit. - Trevor