Class: Effective::EventAddon
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::EventAddon
- Defined in:
- app/models/effective/event_addon.rb
Instance Method Summary collapse
- #last_first_name ⇒ Object
-
#mark_registered! ⇒ Object
This is the Admin Save and Mark Registered historic action.
- #name ⇒ Object
- #qb_item_name ⇒ Object
- #registered? ⇒ Boolean
- #tax_exempt ⇒ Object
- #title ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#last_first_name ⇒ Object
75 76 77 |
# File 'app/models/effective/event_addon.rb', line 75 def last_first_name "#{last_name}, #{first_name}" end |
#mark_registered! ⇒ Object
This is the Admin Save and Mark Registered historic action
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'app/models/effective/event_addon.rb', line 92 def mark_registered! raise('expected a blank event registration') if event_registration.present? save! unless registered? order = Effective::Order.new(items: self, user: owner) order.purchase!(skip_buyer_validations: true, email: false) end true end |
#name ⇒ Object
71 72 73 |
# File 'app/models/effective/event_addon.rb', line 71 def name "#{first_name} #{last_name}" end |
#qb_item_name ⇒ Object
83 84 85 |
# File 'app/models/effective/event_addon.rb', line 83 def qb_item_name event_product.qb_item_name end |
#registered? ⇒ Boolean
87 88 89 |
# File 'app/models/effective/event_addon.rb', line 87 def registered? purchased_or_deferred? end |
#tax_exempt ⇒ Object
79 80 81 |
# File 'app/models/effective/event_addon.rb', line 79 def tax_exempt event_product.tax_exempt end |
#title ⇒ Object
66 67 68 69 |
# File 'app/models/effective/event_addon.rb', line 66 def title return event_product.to_s unless first_name.present? && last_name.present? "#{event_product} - #{last_first_name}" end |
#to_s ⇒ Object
62 63 64 |
# File 'app/models/effective/event_addon.rb', line 62 def to_s persisted? ? title : 'addon' end |