Nested attributes can't be changed dynamically #57

Open
joegatt opened this Issue Aug 11, 2013 · 2 comments

Comments

Projects
None yet
3 participants
@joegatt

joegatt commented Aug 11, 2013

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
@songjiayang

This comment has been minimized.

Show comment Hide comment
@songjiayang

songjiayang Aug 31, 2013

yes , the same problem with you

yes , the same problem with you

@hoesli

This comment has been minimized.

Show comment Hide comment
@hoesli

hoesli Jan 17, 2017

This works for me

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

hoesli commented Jan 17, 2017

This works for me

Settings.nested[:myothersetting] = 20
Settings.nested.myothersetting  # puts 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment