Sha256: 34539829071ca70ec89f2a5286c3034df6bf7fc8c12a4220715cba4d3c3d99bb

Contents?: true

Size: 1.28 KB

Versions: 18

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

class Spree::StoreCreditCategory < Spree::Base
  GIFT_CARD = 'Gift Card'
  REIMBURSEMENT = 'Reimbursement'

  class_attribute :non_expiring_credit_types
  self.non_expiring_credit_types = [Spree::StoreCreditType::NON_EXPIRING]

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

  # @deprecated
  def self.reimbursement_category(reimbursement)
    reimbursement.store_credit_category
  end

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

  public_instance_methods.grep(/^reimbursement_category_name/).each do |method|
    deprecate(
      method => 'Use Spree::Reimbursement#store_credit_category.name instead',
      deprecator: Spree::Deprecation
    )
  end

  class << self
    public_instance_methods.grep(/^reimbursement_category_name/).each do |method|
      deprecate(
        method => 'Use Spree::Reimbursement.store_credit_category.name instead',
        deprecator: Spree::Deprecation
      )
    end

    public_instance_methods.grep(/^reimbursement_category$/).each do |method|
      deprecate(
        method => 'Use Spree::Reimbursement.store_credit_category instead',
        deprecator: Spree::Deprecation
      )
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
solidus_core-2.11.17 app/models/spree/store_credit_category.rb
solidus_core-2.11.16 app/models/spree/store_credit_category.rb
solidus_core-2.11.15 app/models/spree/store_credit_category.rb
solidus_core-2.11.14 app/models/spree/store_credit_category.rb
solidus_core-2.11.13 app/models/spree/store_credit_category.rb
solidus_core-2.11.12 app/models/spree/store_credit_category.rb
solidus_core-2.11.11 app/models/spree/store_credit_category.rb
solidus_core-2.11.10 app/models/spree/store_credit_category.rb
solidus_core-2.11.9 app/models/spree/store_credit_category.rb
solidus_core-2.11.8 app/models/spree/store_credit_category.rb
solidus_core-2.11.7 app/models/spree/store_credit_category.rb
solidus_core-2.11.6 app/models/spree/store_credit_category.rb
solidus_core-2.11.5 app/models/spree/store_credit_category.rb
solidus_core-2.11.4 app/models/spree/store_credit_category.rb
solidus_core-2.11.3 app/models/spree/store_credit_category.rb
solidus_core-2.11.2 app/models/spree/store_credit_category.rb
solidus_core-2.11.1 app/models/spree/store_credit_category.rb
solidus_core-2.11.0 app/models/spree/store_credit_category.rb