I know that you can create named scopes in Rails that allow you to specify conditions that can then be built later:
named_scope :active, :conditions => {:active => true} ... MyModel.active.find(...)
This works by creating a proxy object that does not take longer to evaluate. I want to know if it is possible to create a dynamic nameless region?
By this I mean, is there a foo method that I can go with
scope = MyModel.foo(:conditions => {:target_id => 4})
and then pass scope around as a proxy object, which can I make more .find or other scope calls?
source share