defaults in settings.rb where value is false cannot be retrieved (nil is given instead) #4

Open
shotty01 opened this Issue Feb 15, 2012 · 2 comments

Projects

None yet

2 participants

@shotty01

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

@ledermann

This is fixed in my fork, please see ledermann/rails-settings#4

@shotty01

thnx i switched to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment