Sha256: 7137c5ff00b4c962b5c14ba611fff09307e851b02d5c560f29487cc0ca5a63aa
Contents?: true
Size: 826 Bytes
Versions: 14
Compression:
Stored size: 826 Bytes
Contents
module Spree # Singleton class to access the configuration object (AppConfiguration.first by default) and it's preferences. # # Usage: # Spree::Config[:foo] # Returns the +foo+ preference # Spree::Config[] # Returns a Hash with all the application preferences # Spree::Config.intance # Returns the configuration object (AppConfiguration.first) # Spree::Config.set(preferences_hash) # Set the application preferences as especified in +preference_hash+ class Config include Singleton include PreferenceAccess class << self def instance return nil unless ActiveRecord::Base.connection.tables.include?('configurations') AppConfiguration.find_or_create_by_name("Default configuration") end end end end
Version data entries
14 entries across 14 versions & 2 rubygems