Sha256: e10e2e6100eb30ab04dbb4336359bb3c2580cba7870a19cc6223cda5818d419a

Contents?: true

Size: 774 Bytes

Versions: 8

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

module Spree
  class ReimbursementType < Spree::Base
    scope :active, -> { where(active: true) }
    default_scope -> { order(arel_table[:name].lower) }

    validates :name, presence: true, uniqueness: { case_sensitive: false, allow_blank: true }

    ORIGINAL = 'original'

    has_many :return_items

    self.allowed_ransackable_attributes = %w[name]

    # This method will reimburse the return items based on however it child implements it
    # By default it takes a reimbursement, the return items it needs to reimburse, and if
    # it is a simulation or a real reimbursement. This should return an array
    def self.reimburse(_reimbursement, _return_items, _simulate, *_optional_args)
      raise "Implement me"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
solidus_core-4.4.2 app/models/spree/reimbursement_type.rb
solidus_core-4.4.1 app/models/spree/reimbursement_type.rb
solidus_core-4.4.0 app/models/spree/reimbursement_type.rb
solidus_core-4.3.4 app/models/spree/reimbursement_type.rb
solidus_core-4.3.3 app/models/spree/reimbursement_type.rb
solidus_core-4.3.2 app/models/spree/reimbursement_type.rb
solidus_core-4.3.1 app/models/spree/reimbursement_type.rb
solidus_core-4.3.0 app/models/spree/reimbursement_type.rb