ref: master
lib/tasks/sessions.rake
1 2 3 4 5 6 7
namespace :sessions do desc "Trim old sessions from the table" task :trim => [:environment, 'db:load_config'] do Session.where("updated_at < ?", 30.days.ago).delete_all end end