class SomeModel < ActiveRecord::Base
named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
end
I want to extend the AR::Base class to have this named_scope for all models, how I can do this ?
class SomeModel < ActiveRecord::Base
named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
end
I want to extend the AR::Base class to have this named_scope for all models, how I can do this ?