-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
If I configure an item like this
geoip_whitelist_countries:
default: []
type: list
- it returns a correct [] as the default using
Configurable.geoip_whitelist_countries
- It allows for updating with
Configurable.find_or_create_by(name: 'geoip_whitelist_countries').update_attribute(:value, "AF")
- and returns a correct ["AF"]
- it allows for updating with
Configurable.find_or_create_by(name: 'geoip_whitelist_countries').update_attribute(:value, ["AF", "CH"])
- and returns a wrong value of
[["[\"AF\"", " \"CH\"]"]]
where I expect a ["AF", "CH"]
- and returns a wrong value of
- it allows for updating with
Configurable.find_or_create_by(name: 'geoip_whitelist_countries').update_attribute(:value, "AF,CH")
- and returns a wrong value of
[["AF", "CH"]]
(double array wrapping)
- and returns a wrong value of
It seems the serialisation of the array does not work, a single value is stored a single string, an array is stored as escaped string and the return value is always wrapped in an array.
I'd expect the code to store and load arrays of values the way rails does this.
Is there something I missed from the documentation about the list type?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels