Module: ScheduleAttributes::ActiveRecord::Sugar

Defined in:
lib/schedule_attributes/active_record.rb

Instance Method Summary collapse

Instance Method Details

#has_schedule_attributes(options = {:column_name => :schedule}) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/schedule_attributes/active_record.rb', line 18

def has_schedule_attributes(options={:column_name => :schedule})
  options[:column_name] ||= ScheduleAttributes::DEFAULT_ATTRIBUTE_KEY
  @schedule_field = options[:column_name]
  @default_schedule = options[:default_schedule] if options.has_key?(:default_schedule)
  serialize @schedule_field, ScheduleAttributes::Serializer
  include ScheduleAttributes::ActiveRecord
end