Skip to content

Instantly share code, notes, and snippets.

@traviskroberts
Created March 31, 2012 20:10
Show Gist options
  • Save traviskroberts/2268056 to your computer and use it in GitHub Desktop.
Save traviskroberts/2268056 to your computer and use it in GitHub Desktop.
Clear out Authlogic sessions table.
namespace :sessions do
desc "Clean out user sessions from the database."
task :clean => :environment do |variable|
ActiveRecord::SessionStore::Session.destroy_all(['updated_at < ?', 1.week.ago])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment