Sha256: e85bb73521863980690be9419f466c88b19efda5d2b03441fd69acc7c1fb1811

Contents?: true

Size: 779 Bytes

Versions: 33

Compression:

Stored size: 779 Bytes

Contents

class TicketingKit < Kit
  acts_as_kit :with_approval => true do
    activate :unless => :no_owner?
    approve :unless => :no_bank_account?

    when_active do |organization|
      organization.can :access, :paid_ticketing
    end
  end
  
  def friendly_name
    "Paid Event Ticketing"
  end
  
  def pitch
    "Sell tickets"
  end

  def no_owner?
    errors.add(:requirements, "You need to be part of an organization to activate this kit.") if organization.owner.nil?
    organization.owner.nil?
  end

  def no_bank_account?
    errors.add(:requirements, "Your organization needs bank account information first.") if organization.bank_account.nil?
    organization.bank_account.nil?
  end

  def on_pending
    AdminMailer.ticketing_kit_notification(self).deliver
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.beta.1 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.alpha.2 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.alpha.1 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.27 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.26 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.24 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.23 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.21 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.20 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.19 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.18 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.17 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.16 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.15 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.12 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.11 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.10 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.9 app/models/kits/ticketing_kit.rb
artfully_ose-1.2.0.pre.8 app/models/kits/ticketing_kit.rb