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
50 51 52 53 |
# File 'app/models/effective/event_product.rb', line 50 def capacity_available return nil if capacity.blank? [(capacity - registered_event_addons_count), 0].max end |
#purchased_event_addons_count ⇒ Object
59 60 61 |
# File 'app/models/effective/event_product.rb', line 59 def purchased_event_addons_count purchased_event_addons.length end |
#registered_event_addons_count ⇒ Object
55 56 57 |
# File 'app/models/effective/event_product.rb', line 55 def registered_event_addons_count registered_event_addons.length end |
#to_s ⇒ Object
46 47 48 |
# File 'app/models/effective/event_product.rb', line 46 def to_s title.presence || 'New Event Product' end |