Sha256: 3380c75117fcc338ddcdbded2a3e71549dd044611259aa9495be3e6c2be5658a

Contents?: true

Size: 556 Bytes

Versions: 6

Compression:

Stored size: 556 Bytes

Contents

class Spree::StoreCreditCategory < Spree::Base
  class_attribute :non_expiring_credit_types
  self.non_expiring_credit_types = [Spree::StoreCreditType::NON_EXPIRING]

  class_attribute :reimbursement_category_name
  self.reimbursement_category_name = I18n.t('spree.store_credit_category.default')

  def self.reimbursement_category(_reimbursement)
    Spree::StoreCreditCategory.find_by(name: reimbursement_category_name) ||
      Spree::StoreCreditCategory.first
  end

  def non_expiring?
    self.class.non_expiring_credit_types.include? name
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solidus_core-2.5.2 app/models/spree/store_credit_category.rb
solidus_core-2.5.1 app/models/spree/store_credit_category.rb
solidus_core-2.5.0 app/models/spree/store_credit_category.rb
solidus_core-2.5.0.rc1 app/models/spree/store_credit_category.rb
solidus_core-2.5.0.beta2 app/models/spree/store_credit_category.rb
solidus_core-2.5.0.beta1 app/models/spree/store_credit_category.rb