Sha256: 8c9db9dd5cfc83a157a5d021bb7d98bc5957450b5d4a1045bbcabf0022c87a37

Contents?: true

Size: 933 Bytes

Versions: 44

Compression:

Stored size: 933 Bytes

Contents

module Spree
  module Auth
    # Singleton class to access the shipping configuration object (ActiveShippingConfiguration.first by default) and it's preferences.
    #
    # Usage:
    #   Spree::Auth::Config[:foo]                  # Returns the foo preference
    #   Spree::Auth::Config[]                      # Returns a Hash with all the tax preferences
    #   Spree::Auth::Config.instance               # Returns the configuration object (AuthConfiguration.first)
    #   Spree::Auth::Config.set(preferences_hash)  # Set the spree auth preferences as especified in +preference_hash+
    class Config
      include Singleton
      include Spree::PreferenceAccess

      class << self
        def instance
          return nil unless ActiveRecord::Base.connection.tables.include?('configurations')
          SpreeAuthConfiguration.find_or_create_by_name("Default spree_auth configuration")
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 7 rubygems

Version Path
spree_auth-0.70.1 lib/spree/auth/config.rb
spree_auth-0.70.0 lib/spree/auth/config.rb
spree_auth-0.60.2 lib/spree/auth/config.rb
spree_auth-0.70.0.rc2 lib/spree/auth/config.rb
spree_auth-0.70.RC1 lib/spree/auth/config.rb
spree_bushido_auth-0.80.28 lib/spree/auth/config.rb
spree_bushido_auth-0.80.27 lib/spree/auth/config.rb
spree_bushido_auth-0.80.26 lib/spree/auth/config.rb
spree_bushido_auth-0.80.25 lib/spree/auth/config.rb
spree_bushido_auth-0.80.24 lib/spree/auth/config.rb
spree_bushido_auth-0.60.1 lib/spree/auth/config.rb
spree_auth-0.60.1 lib/spree/auth/config.rb
spree_auth-0.60.0 lib/spree/auth/config.rb
spree_auth-0.60.0.RC1 lib/spree/auth/config.rb
spree_auth-0.50.2 lib/spree/auth/config.rb
spree_auth-0.50.1 lib/spree/auth/config.rb
spree_auth-0.50.0 lib/spree/auth/config.rb
spree_auth-0.40.3 lib/spree/auth/config.rb
spree_auth-0.40.2 lib/spree/auth/config.rb
spree_auth-0.40.1 lib/spree/auth/config.rb