Is there a way to provide “sticky” options to ActiveRecord::Base::Find ?
I’m thinking something with a use model like:
class Function < ActiveRecord::Base
sticky :conditions => “lft > 0”, :order => “lft ASC”
end
Where all subsuquent find operations have those options applied. In
this
case:
Function.find(:all)
Would actually be equivalent to:
Function.find(:all, :conditions => “lft > 0”, :order => “lft ASC”)
And
Function.find(:all, :conditions => “parent_id = 0”)
Would actually be equivalent to:
Function.find(:all, :conditions => “lft > 0 AND parent_id = 0”, :order
=>
“lft ASC”)
Thanks,
Ryan