You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
has_settings do |s|
s.key :notifications, :defaults => { :email_frequency => "7" }
end
When I do User.find(9).to_settings_hash, I do see the default applied.
However, when I try User.find(9).settings(:notifications), I just see a {} for value.
Digging in the code, I see that line 16 & 18 of base.rb are initializing just the var with empty stuff, nothing in it. I added value: self.class.default_settings[var] when it is building, it starts to work fine now.
Am I not seeing this magic dust somewhere? Happy to raise pull request if there is a bug here.
The text was updated successfully, but these errors were encountered:
Going by the README, I did try this -
When I do
User.find(9).to_settings_hash
, I do see the default applied.However, when I try
User.find(9).settings(:notifications)
, I just see a{}
for value.Digging in the code, I see that line 16 & 18 of base.rb are initializing just the var with empty stuff, nothing in it. I added
value: self.class.default_settings[var]
when it is building, it starts to work fine now.Am I not seeing this magic dust somewhere? Happy to raise pull request if there is a bug here.
The text was updated successfully, but these errors were encountered: