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_paid! ⇒ Object
This is the Admin Save and Mark Paid action.
- #name ⇒ Object
- #qb_item_name ⇒ Object
- #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_paid! ⇒ Object
This is the Admin Save and Mark Paid action
88 89 90 91 92 93 94 95 96 97 |
# File 'app/models/effective/event_addon.rb', line 88 def mark_paid! raise('expected a blank event registration') if event_registration.present? save! order = Effective::Order.new(items: self, user: owner) order.purchase!(skip_buyer_validations: true, email: false) 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 |
#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 |