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
And in cases where I can't (or prefer to avoid) having defaults, in order to allow "open schema", the only way for me to handle unset keys in the same way as falsy keys, is:
Am I missing some functionality in configatron that will make this easier?
If there is no way to alleviate the above issues, I would love to see a change that allows it - even if it will require me to opt-in to this behavior using some config directive (in case it is desired to avoid introducing a breaking change).
The text was updated successfully, but these errors were encountered:
The [] method of the Store class seems to be a mere wrapper around fetch.
I think you shouldn't use the fetch method because then your request would lack an exit door when the store is locked. (See store.rb#L41.) Shouldn't this step be moved in the fetch function ? Then it should be possible to use it to pass a default value ?
I love configatron, but although it solves a lot of things, it makes it rather difficult to work with unassigned keys.
In a standard hash, or an
OpenStruct
, non existing values are falsy:While in configatron they are truthy:
Even if I want to set defaults, I cannot work with the common ruby syntax:
And instead, I can only do:
And in cases where I can't (or prefer to avoid) having defaults, in order to allow "open schema", the only way for me to handle unset keys in the same way as falsy keys, is:
Am I missing some functionality in configatron that will make this easier?
If there is no way to alleviate the above issues, I would love to see a change that allows it - even if it will require me to opt-in to this behavior using some config directive (in case it is desired to avoid introducing a breaking change).
The text was updated successfully, but these errors were encountered: