settingslogic icon indicating copy to clipboard operation
settingslogic copied to clipboard

Nested attributes can't be changed dynamically

Open joegatt opened this issue 11 years ago • 2 comments

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

joegatt avatar Aug 11 '13 21:08 joegatt

yes , the same problem with you

songjiayang avatar Aug 31 '13 08:08 songjiayang

This works for me

Settings.nested[:myothersetting] = 20
Settings.nested.myothersetting  # puts 20

hoesli avatar Jan 17 '17 13:01 hoesli