https://github.com/atd/rails-scheduler
Provide a Rails application with support for scheduled events
https://github.com/atd/rails-scheduler
Last synced: 10 months ago
JSON representation
Provide a Rails application with support for scheduled events
- Host: GitHub
- URL: https://github.com/atd/rails-scheduler
- Owner: atd
- License: mit
- Created: 2011-12-04T18:40:06.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-09-27T09:52:39.000Z (almost 13 years ago)
- Last Synced: 2025-08-09T20:57:18.238Z (11 months ago)
- Language: Ruby
- Homepage:
- Size: 146 KB
- Stars: 17
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= Rails Scheduler
{
}[https://gemnasium.com/atd/rails-scheduler]
This project provides your Rails application with support for scheduled events
* Provide any model with database-stored scheduler (weekly, monthly, etc..)
* Database queries to obtain instance between dates
* Build Javascript powered scheduler forms
* I18n and l10n support
== Install
Just add gem 'rails-scheduler' to your +Gemfile+ and bundle update
== Usage
A sample migration is available at db/migrate
Then, just add to your model:
class Event < ActiveRecord::Base
scheduler
end
Now, you can create events such as:
event = Event.create(:start_at => Time.now,
:end_at => Time.now + 3.hours,
:frequency => 2, # weekly
:interval => 1, # every 1 week
:week_days => [ 1 ]) # on monday
Event.between(Date.today, Date.today + 15) #=> [ next monday, next monday + 1 week, etc.. ]
This example is based on an Event class. However, it Rails Scheduler works with any
model, provided the suitable database fields are created
== ToDo
* Daily and yearly frequencies
* Generator that copies the migration, at least.
* Use SQL for database query optimization.
See http://www.codeproject.com/KB/database/sqlscheduleselector.aspx