binarylogic / settingslogic

A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.
http://rdoc.info/projects/binarylogic/settingslogic
MIT License
1.4k stars 186 forks source link

Circular dependency and weird behaviour #64

Closed nicohvi closed 10 years ago

nicohvi commented 10 years ago

I have defined app/models/application_config.rb in the following way:

class ApplicationConfig < Settingslogic
  source "#{Rails.root}/config/config.yml"
  namespace Rails.env
end

And config/config.yml:

development:
  test: test

However, this happens when I use the Rails console

Rails.Env
=> 'development'
Application_config.test
=> LoadError: Unable to autoload constant Application_config

And if I try to call Application_config.test again, I get the following error

RuntimeError: Circular dependency detected while autoloading constant Application_config
nicohvi commented 10 years ago

Brainfart on my part - Application_config should of course be ApplicationConfig