Sha256: e0ac0e72edad122eb886537844e6bec49154480f2c7352eb03a09d2495a64943

Contents?: true

Size: 567 Bytes

Versions: 10

Compression:

Stored size: 567 Bytes

Contents

# Methods added to this helper will be available to all templates in the frontend.
module Spree
  module StoreHelper
    def cache_key_for_taxons
      ActiveSupport::Deprecation.warn(<<-EOS, caller)
        cache_key_for_taxons is deprecated. Rails >= 5 has built-in support for collection cache keys.
        Instead in your view use:
        cache [I18n.locale, @taxons] do
      EOS
      max_updated_at = @taxons.maximum(:updated_at).to_i
      parts = [@taxon.try(:id), max_updated_at].compact.join("-")
      "#{I18n.locale}/taxons/#{parts}"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_frontend-3.3.6 app/helpers/spree/store_helper.rb
spree_frontend-3.3.5 app/helpers/spree/store_helper.rb
spree_frontend-3.3.4 app/helpers/spree/store_helper.rb
spree_frontend-3.3.3 app/helpers/spree/store_helper.rb
spree_frontend-3.3.2 app/helpers/spree/store_helper.rb
spree_frontend-3.3.1 app/helpers/spree/store_helper.rb
spree_frontend-3.3.0 app/helpers/spree/store_helper.rb
spree_frontend-3.3.0.rc4 app/helpers/spree/store_helper.rb
spree_frontend-3.3.0.rc3 app/helpers/spree/store_helper.rb
spree_frontend-3.3.0.rc2 app/helpers/spree/store_helper.rb