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-3.3.0 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.5 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.4 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.3 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.1.8 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.0.8 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.2 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.1 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.0 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.2.0.alpha app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.0.7 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-2.11.17 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.1.7 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-2.11.16 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.0.6 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.1.6 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-2.11.15 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-2.11.14 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.0.5 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
solidus_core-3.1.5 app/models/spree/return_item/eligibility_validator/no_reimbursements.rb