views:

19

answers:

1
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 ?

+2  A: 
John Topley