Module: ConfigFor::Rails

Defined in:
lib/config_for/rails.rb

Instance Method Summary collapse

Instance Method Details

#config_for(name) ⇒ ActiveSupport::HashWithIndifferentAccess

Convenience loading of config files

Examples:

in config/production.rb

Rails.application.configure do
  config.redis = config_for(:redis)
end

Parameters:

  • name (String, Symbol)

    the config file to load

Returns:

  • (ActiveSupport::HashWithIndifferentAccess)

    loaded config file

Raises:



14
15
16
# File 'lib/config_for/rails.rb', line 14

def config_for(name)
  ConfigFor.load_config!(paths['config'].existent.first, name, ::Rails.env)
end