Quick fix for Boolean SiteSettings
Boolean SiteSettings are saved as 't' or 'f' on create!, but are being saved as 1 or 0 after update. This quick fix maintains consistency, allowing boolean values to be updated and saved.
This commit is contained in:
parent
0f770260cf
commit
c6e5e3acd2
|
@ -144,7 +144,7 @@ module SiteSettingExtension
|
||||||
type = get_data_type(defaults[name])
|
type = get_data_type(defaults[name])
|
||||||
|
|
||||||
if type == Types::Bool && val != true && val != false
|
if type == Types::Bool && val != true && val != false
|
||||||
val = (val == "t" || val == "true")
|
val = (val == "t" || val == "true") ? 't' : 'f'
|
||||||
end
|
end
|
||||||
|
|
||||||
if type == Types::Fixnum && !(Fixnum === val)
|
if type == Types::Fixnum && !(Fixnum === val)
|
||||||
|
|
Loading…
Reference in New Issue