Sha256: 4ace2c52fbac15dd728e36a5b21af5cbc7a3a5f1a0e46296b1e9b984ed0b6e68

Contents?: true

Size: 510 Bytes

Versions: 86

Compression:

Stored size: 510 Bytes

Contents

module Spree
  class ReturnItem::EligibilityValidator::TimeSincePurchase < Spree::ReturnItem::EligibilityValidator::BaseValidator
    def eligible_for_return?
      if (@return_item.inventory_unit.order.completed_at + Spree::Config[:return_eligibility_number_of_days].days) > Time.current
        return true
      else
        add_error(:number_of_days, Spree.t('return_item_time_period_ineligible'))
        return false
      end
    end

    def requires_manual_intervention?
      false
    end
  end
end

Version data entries

86 entries across 86 versions & 3 rubygems

Version Path
goca-spree-core-3.1.14.rails.5.0.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
goca-spree-core-3.1.14.rails.5.0 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
goca-spree-core-3.1.15.rails.5.0 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
goca-spree-core-3.1.15.pre.rails.pre.5.0 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.2.9 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.1.14 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.3.6 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.2.8 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.1.13 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.3.5 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.3.4 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.2.7 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.1.12 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-2.3.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-2.2.2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-2.1.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-2.0.3 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.4.2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.3.2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.2.3 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb