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
Hey, I was just trying to use the retrieve method and ran into a potential issue.
It first does method_missing to get a value and then checks if it is a store, if so it returns the default.
Is that intended?
For instance, I have nested fields, and some of them are supposed to be stores, and instead of getting the value, I get nil because I did not specify a default.
Should it be:
return (val.is_a?(Configatron::Store) && val.nil?) ? default_value : val
or
vreturn val.nil? ? default_value : val
instead of
return val.is_a?(Configatron::Store) ? default_value : val
Maybe I am misunderstanding the usage of that method. I worked around it by calling method_missing myself and checking for nil.
Thanks for a great library!
The text was updated successfully, but these errors were encountered:
Hey, I was just trying to use the retrieve method and ran into a potential issue.
It first does method_missing to get a value and then checks if it is a store, if so it returns the default.
Is that intended?
For instance, I have nested fields, and some of them are supposed to be stores, and instead of getting the value, I get nil because I did not specify a default.
Should it be:
return (val.is_a?(Configatron::Store) && val.nil?) ? default_value : val
or
vreturn val.nil? ? default_value : val
instead of
return val.is_a?(Configatron::Store) ? default_value : val
Maybe I am misunderstanding the usage of that method. I worked around it by calling method_missing myself and checking for nil.
Thanks for a great library!
The text was updated successfully, but these errors were encountered: