https://github.com/ninech/activerecord_session_cleaner
Gem to remove old sessions from your ActiveRecord DB with a cron job
https://github.com/ninech/activerecord_session_cleaner
Last synced: 3 days ago
JSON representation
Gem to remove old sessions from your ActiveRecord DB with a cron job
- Host: GitHub
- URL: https://github.com/ninech/activerecord_session_cleaner
- Owner: ninech
- License: mit
- Created: 2014-03-14T14:13:44.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-10-24T07:37:41.000Z (over 7 years ago)
- Last Synced: 2025-06-26T16:59:30.315Z (18 days ago)
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 19
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# activerecord_session_cleaner [](http://badge.fury.io/rb/activerecord_session_cleaner) [](https://travis-ci.org/ninech/activerecord_session_cleaner)
Gem to remove old sessions from your ActiveRecord DB.
## Installation
In your Gemfile, add:
``` ruby
gem 'activerecord_session_cleaner'
```## Features
* Delete all sessions
* Delete sessions not updated in the last `$x` days
* Setup cleanup cron to delete old sessions## Tasks
# Delete old sessions from an Active Record session store
rake activerecord_session_cleaner:cleanup:old[days_to_keep]
# Delete all session from an Active Record session store
rake activerecord_session_cleaner:cleanup:all# Setup/update cron for session cleanup
rake activerecord_session_cleaner:crontab:update[application_name,days_to_keep]
# Remove cleanup cron for session cleanup
rake activerecord_session_cleaner:crontab:clear[application_name]Default values:
* `days_to_keep`: `10`
* `application_name`: basename of the current working directory (`example` if you are in `/home/gooby/example`)## License
activerecord_session_cleaner is released under the MIT License. See [LICENSE.txt](LICENSE.txt) for further details.