Sha256: 941f3b26cc6eda4e13dde6e16ac1914da9fb5626f0382046c99842b30034916c

Contents?: true

Size: 419 Bytes

Versions: 10

Compression:

Stored size: 419 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

10 entries across 10 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release app/models/disco_app/application_charge.rb
disco_app-0.14.1 app/models/disco_app/application_charge.rb
disco_app-0.14.2 app/models/disco_app/application_charge.rb
disco_app-0.15.0 app/models/disco_app/application_charge.rb
disco_app-0.16.0 app/models/disco_app/application_charge.rb
disco_app-0.14.4 app/models/disco_app/application_charge.rb
disco_app-0.14.3 app/models/disco_app/application_charge.rb
disco_app-0.16.1 app/models/disco_app/application_charge.rb
disco_app-0.15.2 app/models/disco_app/application_charge.rb
disco_app-0.14.0 app/models/disco_app/application_charge.rb