0
0
Fork 0

Wrong type for user setting when default is defined by lambda (#24321)

This commit is contained in:
Christian Schmidt 2023-03-31 07:33:17 +02:00 committed by GitHub
parent 68a192e718
commit b4f38edf74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 1 deletions

View file

@ -19,7 +19,8 @@ class UserSettings::Setting
end
def type
if @default_value.is_a?(TrueClass) || @default_value.is_a?(FalseClass)
case default_value
when TrueClass, FalseClass
ActiveModel::Type::Boolean.new
else
ActiveModel::Type::String.new