Skip to content

Instantly share code, notes, and snippets.

@nikz
Created March 23, 2009 09:55
Show Gist options
  • Save nikz/83492 to your computer and use it in GitHub Desktop.
Save nikz/83492 to your computer and use it in GitHub Desktop.
# /config/initializers/since.rb
ActiveRecord::Base.class_eval do
[:created, :updated].each do |name|
named_scope "#{name}_since", lambda { |time| { :conditions => ["#{name}_at > ?", time] } }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment