rails-settings
rails-settings copied to clipboard
defaults in settings.rb where value is false cannot be retrieved (nil is given instead)
tried in rails 3.0.1
If I specify a setting default which is false, for example
Settings.defaults[:debug] = false
in my Settings.defaults i see it: ruby-1.9.2-p290 :007 > Settings.defaults => {"bla"=>"blubb", "blubb"=>true, "ble"=>13, "cocktails"=>["Martini", "Black", "White Russian"], "debug"=>false}
but Settings.debug gives me back nil instead of false.
ruby-1.9.2-p290 :008 > Settings.debug
Settings Load (0.6ms) SELECT settings.* FROM settings WHERE settings.var = 'debug' LIMIT 1
=> nil
If i specify a default with the value true everything works fine.
ruby-1.9.2-p290 :009 > Settings.defaults[:debug] = true
=> true
ruby-1.9.2-p290 :010 > Settings.debug
Settings Load (0.5ms) SELECT settings.* FROM settings WHERE settings.var = 'debug' LIMIT 1
=> true
This is fixed in my fork, please see https://github.com/ledermann/rails-settings/issues/4
thnx i switched to it