mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:31:18 +08:00
FIX: if an enum is Fixnum do not allow strings to live in it
This commit is contained in:
@ -291,6 +291,7 @@ module SiteSettingExtension
|
||||
end
|
||||
|
||||
if type == types[:enum]
|
||||
val = val.to_i if Fixnum === defaults[name.to_sym]
|
||||
if enum_class(name)
|
||||
raise Discourse::InvalidParameters.new(:value) unless enum_class(name).valid_value?(val)
|
||||
else
|
||||
|
Reference in New Issue
Block a user