Class: Effective::MembershipHistory
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::MembershipHistory
- Defined in:
- app/models/effective/membership_history.rb
Instance Method Summary collapse
-
#membership_categories ⇒ Object
These two accessors are for the memberships history form.
- #membership_category_ids ⇒ Object
- #membership_category_ids=(ids) ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#membership_categories ⇒ Object
These two accessors are for the memberships history form. But we just assign categories and category_ids directly in registrar.
43 44 45 |
# File 'app/models/effective/membership_history.rb', line 43 def membership_categories category_ids.present? ? EffectiveMemberships.Category.where(id: category_ids) : [] end |
#membership_category_ids ⇒ Object
47 48 49 |
# File 'app/models/effective/membership_history.rb', line 47 def membership_category_ids membership_categories.map(&:id) end |
#membership_category_ids=(ids) ⇒ Object
51 52 53 54 |
# File 'app/models/effective/membership_history.rb', line 51 def membership_category_ids=(ids) categories = EffectiveMemberships.Category.where(id: ids) assign_attributes(categories: categories.map(&:to_s), category_ids: categories.map(&:id)) end |
#to_s ⇒ Object
37 38 39 |
# File 'app/models/effective/membership_history.rb', line 37 def to_s 'membership history' end |