Sha256: 5be1b89f5b865ff3d0bfc12ef2bf10f3e4e3bf8ca3659c4cdb34a7990703b3a7

Contents?: true

Size: 418 Bytes

Versions: 7

Compression:

Stored size: 418 Bytes

Contents

class DiscoApp::ApplicationCharge < ApplicationRecord

  belongs_to :shop
  belongs_to :subscription

  enum status: {
    pending: 0,
    accepted: 1,
    declined: 2,
    expired: 3,
    active: 4
  }

  scope :active, -> { where status: statuses[:active] }

  def recurring?
    false
  end

  def activate_url
    DiscoApp::Engine.routes.url_helpers.activate_subscription_charge_url(subscription, self)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.17.0 app/models/disco_app/application_charge.rb
disco_app-0.18.0 app/models/disco_app/application_charge.rb
disco_app-0.18.2 app/models/disco_app/application_charge.rb
disco_app-0.18.3 app/models/disco_app/application_charge.rb
disco_app-0.18.6 app/models/disco_app/application_charge.rb
disco_app-0.18.4 app/models/disco_app/application_charge.rb
disco_app-0.18.1 app/models/disco_app/application_charge.rb