Class: Effective::EventAddon

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/event_addon.rb

Instance Method Summary collapse

Instance Method Details

#mark_paid!Object

This is the Admin Save and Mark Paid action



59
60
61
62
63
64
65
66
67
68
# File 'app/models/effective/event_addon.rb', line 59

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

#qb_item_nameObject



54
55
56
# File 'app/models/effective/event_addon.rb', line 54

def qb_item_name
  event_product.qb_item_name
end

#tax_exemptObject



50
51
52
# File 'app/models/effective/event_addon.rb', line 50

def tax_exempt
  event_product.tax_exempt
end

#to_sObject



46
47
48
# File 'app/models/effective/event_addon.rb', line 46

def to_s
  persisted? ? event_product.to_s : 'product'
end