Class: Rsvp::Person
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Rsvp::Person
- Defined in:
- app/models/rsvp/person.rb
Class Method Summary collapse
- .adult_females ⇒ Object
- .adult_males ⇒ Object
- .children ⇒ Object
- .young_females ⇒ Object
- .young_males ⇒ Object
Instance Method Summary collapse
Class Method Details
.adult_females ⇒ Object
16 17 18 |
# File 'app/models/rsvp/person.rb', line 16 def self.adult_females where("gender_type = ?", Gender::AdultFemale.to_s) end |
.adult_males ⇒ Object
12 13 14 |
# File 'app/models/rsvp/person.rb', line 12 def self.adult_males where("gender_type = ?", Gender::AdultMale.to_s) end |
.children ⇒ Object
28 29 30 |
# File 'app/models/rsvp/person.rb', line 28 def self.children young_females + young_males end |
.young_females ⇒ Object
20 21 22 |
# File 'app/models/rsvp/person.rb', line 20 def self.young_females where("gender_type = ?", Gender::YoungFemale.to_s) end |
Instance Method Details
#gender_type ⇒ Object
36 37 38 |
# File 'app/models/rsvp/person.rb', line 36 def gender_type read_attribute(:gender_type).try(:constantize) end |
#gender_type=(klass) ⇒ Object
32 33 34 |
# File 'app/models/rsvp/person.rb', line 32 def gender_type=(klass) write_attribute(:gender_type, klass.to_s) end |