Sha256: 39c96e6783efc1bbb21df5c7aec1449bfc90f6da7b74fa0a49489d670fa4b539

Contents?: true

Size: 506 Bytes

Versions: 44

Compression:

Stored size: 506 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.now
        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

44 entries across 44 versions & 2 rubygems

Version Path
solidus_core-1.0.2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.4 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-2.4.10 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.0 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.0.rc2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.0.rc1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.3 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-2.4.9 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.0.pre3 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.0.pre2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-2.4.8 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.0.pre app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-2.4.7 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.0 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-2.4.6 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-2.4.5 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.0.rc4 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb