Class: Event
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Event
show all
- Extended by:
- Informatible
- Defined in:
- app/models/event.rb
Overview
type наименование класса события memory_id id памяти, событие которой произошло place_id id места, где произошло событие item_id id предмета, к которому применяется событие
Direct Known Subclasses
Adoration, Annunciation, Apparation, Appearance, Ascension, Assurance, Baptism, Battle, Benediction, Betraial, Bishopry, Burial, Calling, Canonization, Captivity, Circumcision, Conceiving, Conception, Council, Curse, Deaconry, Decanonization, Dedication, Defrocking, Deliverance, Deposition, Destruction, Earthquake, Enheresment, Entrance, Exaltation, Fall, Founding, Frockbearing, Funeral, Glorification, GreatFire, Hiddening, Hypodeaconry, Incarnation, Labor, Learning, Liberation, Loss, Marriage, Meeting, Miracle, Monasticry, Nativity, Numbness, Passion, Phenomenon, Placing, Portent, Preach, Priestship, Primacy, Procession, Prophecy, Protection, PuttingInAgain, Reader, Renunciation, Repentance, Repose, Rest, Restoration, Resurrection, Revival, Sanctification, Schima, Schism, Sobriety, SoldierMemory, Superstructure, Supper, Tale, Teleportation, Thanksgiving, Throne, Transferal, Transfiguration, Translation, Uncovering, Veneration, Writing
Constant Summary
collapse
- USUAL =
[
'Marriage',
'Exaltation',
'Ascension',
'Restoration',
'Resurrection',
'Entrance',
'Conception',
'Protection',
'Conceiving',
'Writing',
'Sanctification',
'Uncovering',
'Circumcision',
'Revival',
'Renunciation',
'Placing',
'Translation',
'Adoration',
'Transfiguration',
'Repose',
'Nativity',
'Council',
'Meeting',
'Passion',
'Supper',
'Assurance',
'Miracle',
'Appearance',
]
Instance Method Summary
collapse
extended
Instance Method Details
#description_for(language_code) ⇒ Object
66
67
|
# File 'app/models/event.rb', line 66
def description_for language_code
descriptions.where(language_code: language_code).first ;end
|
#happened_at ⇒ Object
88
89
90
|
# File 'app/models/event.rb', line 88
def happened_at
value = read_attribute(:happened_at)
value.to_s =~ /,/ && value.split(/,\*/) || value ;end
|
#happened_at=(value) ⇒ Object
84
85
86
|
# File 'app/models/event.rb', line 84
def happened_at= value
value.is_a?(Array) && super(value.join('/')) || super
end
|
#kind_for(language_code) ⇒ Object
63
64
|
# File 'app/models/event.rb', line 63
def kind_for language_code
kinds.where(language_code: language_code).first ;end
|
#kontakions(text_present = true) ⇒ Object
76
77
78
|
# File 'app/models/event.rb', line 76
def kontakions text_present = true
relation = Kontakion.joins( :services ).where( services: { id: services.pluck( :id ) } )
text_present && relation.where.not( { text: nil } ) || relation ;end
|
#kontakions_for(language_code, text_present = true) ⇒ Object
80
81
|
# File 'app/models/event.rb', line 80
def kontakions_for language_code, text_present = true
kontakions( text_present ).where(language_code: language_code) ;end
|
#troparions(text_present = true) ⇒ Object
69
70
71
|
# File 'app/models/event.rb', line 69
def troparions text_present = true
relation = Troparion.joins( :services ).where( services: { id: services.pluck( :id ) } )
text_present && relation.where.not( { text: nil } ) || relation ;end
|
#troparions_for(language_code, text_present = true) ⇒ Object
73
74
|
# File 'app/models/event.rb', line 73
def troparions_for language_code, text_present = true
troparions( text_present ).where(language_code: language_code) ;end
|