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
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"]
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)
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.
The text was updated successfully, but these errors were encountered:
If I configure an item like this
Configurable.geoip_whitelist_countries
Configurable.find_or_create_by(name: 'geoip_whitelist_countries').update_attribute(:value, "AF")
Configurable.find_or_create_by(name: 'geoip_whitelist_countries').update_attribute(:value, ["AF", "CH"])
[["[\"AF\"", " \"CH\"]"]]
where I expect a ["AF", "CH"]Configurable.find_or_create_by(name: 'geoip_whitelist_countries').update_attribute(:value, "AF,CH")
[["AF", "CH"]]
(double array wrapping)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.
The text was updated successfully, but these errors were encountered: