Revert "Merge pull request #15550 from sgrif/sg-numeric-types"

This reverts commit be1db994, reversing
changes made to 6680ee94.

Reason: This changed a behavior where numeric attributes when receiving
blank values didn't change its value.
上级 be1db994
......@@ -5,14 +5,13 @@ def number?
true
end
def type_cast(value)
value = case value
when true then 1
when false then 0
when ::String then value.presence
else value
end
super(value)
def type_cast_for_write(value)
case value
when true then 1
when false then 0
when ::String then value.presence
else super
end
end
def changed?(old_value, new_value) # :nodoc:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册