rails-settings icon indicating copy to clipboard operation
rails-settings copied to clipboard

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

Open shotty01 opened this issue 13 years ago • 2 comments

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

shotty01 avatar Feb 15 '12 16:02 shotty01

This is fixed in my fork, please see https://github.com/ledermann/rails-settings/issues/4

ledermann avatar Feb 15 '12 17:02 ledermann

thnx i switched to it

shotty01 avatar Mar 27 '12 14:03 shotty01