Module: CalendarizeHelper::Model
- Defined in:
- app/helpers/calendarize_helper.rb
Overview
Methods used in an ActiveRecord model to make it compatible with the library Note: A model must respond to :start_time and :end_time (:datetime fields)
Usage:
class MyEventModel < ActiveRecord::Base
acts_as_event
end
class MyEventsMigration < ActiveRecord::Migration
def change
create_table :my_events do |t|
t.datetime :start_time
t.datetime :end_time
end
end
end
I did not want to dictate how your event model should be; that’s why you must create your event model and your migration. However, once this is done, you can use :acts_as_event to ease the process. It will add the scopes needed to send the events to the calendars.
Note: You can have an event model that is not persisted in your database. As long as your model responds to the two methods :start_time and :end_time, you’re OK. However, :acts_as_event won’t help you in that case.
Defined Under Namespace
Modules: ActsAsEvent