Class: Spree::ReturnItem::EligibilityValidator::NoReimbursements
- Inherits:
-
BaseValidator
- Object
- BaseValidator
- Spree::ReturnItem::EligibilityValidator::NoReimbursements
show all
- Defined in:
- app/models/spree/return_item/eligibility_validator/no_reimbursements.rb
Instance Attribute Summary
#errors
Instance Method Summary
collapse
#initialize
Instance Method Details
#eligible_for_return? ⇒ Boolean
7
8
9
10
11
12
13
14
|
# File 'app/models/spree/return_item/eligibility_validator/no_reimbursements.rb', line 7
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
|
#requires_manual_intervention? ⇒ Boolean
16
17
18
|
# File 'app/models/spree/return_item/eligibility_validator/no_reimbursements.rb', line 16
def requires_manual_intervention?
@errors.present?
end
|