Module: SubjModels::EventScheduleModule

Includes:
TypesSupport::EventTypes, ValuesChecker
Defined in:
lib/subj_models/event_schedule.rb

Constant Summary

Constants included from TypesSupport::EventTypes

TypesSupport::EventTypes::EVENT_TYPES, TypesSupport::EventTypes::OFFLINE, TypesSupport::EventTypes::WEBINAR

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ValuesChecker

#check_string_for_int

Class Method Details

.included(including_class) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/subj_models/event_schedule.rb', line 12

def self.included(including_class)

  including_class.class_eval do

    include SubjModels::ComprisingExternalId

    enum event_type: EVENT_TYPES

    belongs_to :event
    belongs_to :office

    validates :event_date, presence: true

    scope :event_id, -> (event_id) { parent_id_scope(event_id: event_id) }

  end

end

Instance Method Details

#event_type=(value) ⇒ Object



35
36
37
# File 'lib/subj_models/event_schedule.rb', line 35

def event_type=(value)
  super(check_string_for_int(value))
end

#to_sObject



31
32
33
# File 'lib/subj_models/event_schedule.rb', line 31

def to_s
  id.to_s # TODO
end