settingslogic
settingslogic copied to clipboard
Nested attributes can't be changed dynamically
I'm using the settingslogic gem in my Rails app (Ruby 2.0.0p247 / Rails 3.2.13).
I can dynamically change a setting when it is not nested e.g.
#config/settings.yml
defaults:&defaults
mysetting: 1
nested:
myothersetting: 2
Settings[:mysetting] = 10
Settings.mysetting # puts 10
But I am unable to change a nested attribute in the same way:
Settings[:nested][:myothersetting] = 20
Settings.nested.myothersetting # puts 2
yes , the same problem with you
This works for me
Settings.nested[:myothersetting] = 20
Settings.nested.myothersetting # puts 20