Sha256: b0574afe88a4f6a2bacd6ae3d0d3e137cce69bed7b08837e47b808ba58f038f1

Contents?: true

Size: 394 Bytes

Versions: 33

Compression:

Stored size: 394 Bytes

Contents

module Spree
  module Stores
    class FindCurrent
      def initialize(scope: nil, url: nil)
        @scope = scope || Spree::Store
        @url = url
      end

      def execute
        by_url(scope) || scope.default
      end

      protected

      attr_reader :scope, :url

      def by_url(scope)
        return if url.blank?

        scope.by_url(url).first
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
spree_core-4.10.1 app/finders/spree/stores/find_current.rb
spree_core-4.10.0 app/finders/spree/stores/find_current.rb
spree_core-4.9.0 app/finders/spree/stores/find_current.rb
spree_core-4.8.3 app/finders/spree/stores/find_current.rb
spree_core-4.8.2 app/finders/spree/stores/find_current.rb
spree_core-4.7.3 app/finders/spree/stores/find_current.rb
spree_core-4.6.6 app/finders/spree/stores/find_current.rb
spree_core-4.5.5 app/finders/spree/stores/find_current.rb
spree_core-4.3.3 app/finders/spree/stores/find_current.rb
spree_core-4.4.1 app/finders/spree/stores/find_current.rb
spree_core-4.5.4 app/finders/spree/stores/find_current.rb
spree_core-4.6.5 app/finders/spree/stores/find_current.rb
spree_core-4.7.2 app/finders/spree/stores/find_current.rb
spree_core-4.7.1 app/finders/spree/stores/find_current.rb
spree_core-4.6.4 app/finders/spree/stores/find_current.rb
spree_core-4.7.0 app/finders/spree/stores/find_current.rb
spree_core-4.6.3 app/finders/spree/stores/find_current.rb
spree_core-4.6.2 app/finders/spree/stores/find_current.rb
spree_core-4.6.1 app/finders/spree/stores/find_current.rb
spree_core-4.6.0 app/finders/spree/stores/find_current.rb