Sha256: 3bb94dd19e611ed13117a7d128e4ed7cd4809ef01bf94872370ecfbf5b71bd38

Contents?: true

Size: 444 Bytes

Versions: 17

Compression:

Stored size: 444 Bytes

Contents

class DiscoApp::RecurringApplicationCharge < ApplicationRecord

  belongs_to :shop
  belongs_to :subscription

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

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

  def recurring?
    true
  end

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

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release app/models/disco_app/recurring_application_charge.rb
disco_app-0.14.1 app/models/disco_app/recurring_application_charge.rb
disco_app-0.14.2 app/models/disco_app/recurring_application_charge.rb
disco_app-0.15.0 app/models/disco_app/recurring_application_charge.rb
disco_app-0.16.0 app/models/disco_app/recurring_application_charge.rb
disco_app-0.17.0 app/models/disco_app/recurring_application_charge.rb
disco_app-0.18.0 app/models/disco_app/recurring_application_charge.rb
disco_app-0.18.2 app/models/disco_app/recurring_application_charge.rb
disco_app-0.14.4 app/models/disco_app/recurring_application_charge.rb
disco_app-0.18.3 app/models/disco_app/recurring_application_charge.rb
disco_app-0.18.6 app/models/disco_app/recurring_application_charge.rb
disco_app-0.14.3 app/models/disco_app/recurring_application_charge.rb
disco_app-0.16.1 app/models/disco_app/recurring_application_charge.rb
disco_app-0.15.2 app/models/disco_app/recurring_application_charge.rb
disco_app-0.18.4 app/models/disco_app/recurring_application_charge.rb
disco_app-0.18.1 app/models/disco_app/recurring_application_charge.rb
disco_app-0.14.0 app/models/disco_app/recurring_application_charge.rb