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.7 lib/spree/auth/config.rb
spree_auth-0.70.6 lib/spree/auth/config.rb
apispree_auth-0.0.0 lib/spree/auth/config.rb
My-Commerce_auth-1.1.0 lib/spree/auth/config.rb
My-Commerce_auth-1.0.0 lib/spree/auth/config.rb
MyCommerceapi-1.0.0 auth/lib/spree/auth/config.rb
MyCommerce-0.0.3 auth/lib/spree/auth/config.rb
rfcommerce_auth-0.0.3 lib/spree/auth/config.rb
spree_auth-0.60.6 lib/spree/auth/config.rb
spree_auth-0.70.5 lib/spree/auth/config.rb
spree_auth-0.70.4 lib/spree/auth/config.rb
spree_auth-0.60.5 lib/spree/auth/config.rb
spree_auth-0.70.3 lib/spree/auth/config.rb
spree_auth-0.70.2 lib/spree/auth/config.rb
spree_auth-0.30.2 lib/spree/auth/config.rb
spree_auth-0.40.4 lib/spree/auth/config.rb
spree_auth-0.50.4 lib/spree/auth/config.rb
spree_auth-0.60.4 lib/spree/auth/config.rb
spree_auth-0.50.3 lib/spree/auth/config.rb
spree_auth-0.60.3 lib/spree/auth/config.rb