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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---