Sha256: e98fce5c064adfc4443b6bf5268cc33b882219fba663d481c5cdf69aff6c70a6

Contents?: true

Size: 595 Bytes

Versions: 133

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

module Spree
  class ReturnItem < Spree::Base
    module EligibilityValidator
      class NoReimbursements < Spree::ReturnItem::EligibilityValidator::BaseValidator
        def eligible_for_return?
          if @return_item.inventory_unit.return_items.reimbursed.valid.any?
            add_error(:inventory_unit_reimbursed, I18n.t('spree.return_item_inventory_unit_reimbursed'))
            false
          else
            true
          end
        end

        def requires_manual_intervention?
          @errors.present?
        end
      end
    end
  end
end

Version data entries

133 entries across 133 versions & 2 rubygems

Version Path
solidus_core-4.4.2 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.4.1 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.4.0 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.3.4 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.2.4 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.1.5 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.3.3 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.3.2 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.1.4 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.3.1 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.3.0 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.2.3 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.1.3 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.0.4 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.4.6 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.0.3 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.1.2 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.2.2 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.4.5 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-4.2.1 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb