Class: Spree::ReturnItem::EligibilityValidator::RMARequired

Inherits:
BaseValidator
  • Object
show all
Defined in:
app/models/spree/return_item/eligibility_validator/rma_required.rb

Instance Attribute Summary

Attributes inherited from BaseValidator

#errors

Instance Method Summary collapse

Methods inherited from BaseValidator

#initialize

Constructor Details

This class inherits a constructor from Spree::ReturnItem::EligibilityValidator::BaseValidator

Instance Method Details

#eligible_for_return?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
# File 'app/models/spree/return_item/eligibility_validator/rma_required.rb', line 5

def eligible_for_return?
  if @return_item.return_authorization.present?
    return true
  else
    add_error(:rma_required, I18n.t('spree.return_item_rma_ineligible'))
    return false
  end
end

#requires_manual_intervention?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/spree/return_item/eligibility_validator/rma_required.rb', line 14

def requires_manual_intervention?
  false
end