`max` and `min` as settings names behave unexpectedly
supremebeing7 opened this issue · 2 comments
supremebeing7 commented
This is on version 2.0.0
Using max
and min
appear to be reserved words and will behave unexpectedly.
settings_group:
max: "max"
min: "min"
other: "other"
Expected
> Settings.settings_group.max
=> "max"
> Settings.settings_group.min
=> "min"
> Settings.settings_group.other
=> "other"
Actual
> Settings.settings_group.max
=> [:other, "other"]
> Settings.settings_group.min
=> [:max, "max"]
> Settings.settings_group.other
=> "other"
supremebeing7 commented
I assume this is happening because config groups are being treated in some way like arrays?
[1] pry(main)> [1,2,3].max
=> 3
[2] pry(main)> [1,2,3].min
=> 1
supremebeing7 commented
I think I've got a fix, it's just adding those to the SETTINGS_RESERVED_WORDS
. I'll get a PR up in a second.