mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use type.serializable?
in unboundable?
This commit is contained in:
parent
dc96825d44
commit
6efe2b4900
1 changed files with 3 additions and 7 deletions
|
@ -31,14 +31,10 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def unboundable?
|
def unboundable?
|
||||||
if defined?(@_unboundable)
|
unless defined?(@_unboundable)
|
||||||
@_unboundable
|
@_unboundable = !type.serializable?(value) && type.cast(value) <=> 0
|
||||||
else
|
|
||||||
value_for_database unless value_before_type_cast.is_a?(StatementCache::Substitute)
|
|
||||||
@_unboundable = nil
|
|
||||||
end
|
end
|
||||||
rescue ::RangeError
|
@_unboundable
|
||||||
@_unboundable = type.cast(value_before_type_cast) <=> 0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue