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.1.4 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.7 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.10 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.9 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.6 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.8 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.7 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.3 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.5 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.6.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.6 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
spree_core-3.0.5 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.4 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.0.3 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.0 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.0.pre2 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.0.pre1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb
solidus_core-1.1.0.beta1 app/models/spree/return_item/eligibility_validator/time_since_purchase.rb