Class: Effective::EventProduct
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::EventProduct
- Defined in:
- app/models/effective/event_product.rb
Instance Method Summary collapse
- #capacity_available ⇒ Object
- #purchased_event_addons_count ⇒ Object
- #registered_event_addons_count ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#capacity_available ⇒ Object
49 50 51 52 |
# File 'app/models/effective/event_product.rb', line 49 def capacity_available return nil if capacity.blank? [(capacity - registered_event_addons_count), 0].max end |
#purchased_event_addons_count ⇒ Object
58 59 60 |
# File 'app/models/effective/event_product.rb', line 58 def purchased_event_addons_count purchased_event_addons.length end |
#registered_event_addons_count ⇒ Object
54 55 56 |
# File 'app/models/effective/event_product.rb', line 54 def registered_event_addons_count registered_event_addons.length end |
#to_s ⇒ Object
45 46 47 |
# File 'app/models/effective/event_product.rb', line 45 def to_s title.presence || 'New Event Product' end |