1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

BindParam should not be passed to type_cast_for_database

This commit is contained in:
Ryuta Kamizono 2020-06-03 03:17:03 +09:00
parent a7c187343e
commit e9b2dde297
4 changed files with 4 additions and 6 deletions

View file

@ -9,7 +9,6 @@ module ActiveRecord
end
def type_cast_for_database(attr_name, value)
return value if value.is_a?(Arel::Nodes::BindParam)
type = type_for_attribute(attr_name)
type.serialize(value)
end

View file

@ -8,7 +8,6 @@ module ActiveRecord
end
def type_cast_for_database(attr_name, value)
return value if value.is_a?(Arel::Nodes::BindParam)
type = type_for_attribute(attr_name)
type.serialize(value)
end

View file

@ -15,8 +15,8 @@ module Arel # :nodoc: all
relation.respond_to?(:name) ? relation.name : name
end
def type_cast_for_database(*args)
relation.type_cast_for_database(*args)
def type_cast_for_database(attr_name, value)
relation.type_cast_for_database(attr_name, value)
end
def type_for_attribute(name)

View file

@ -97,8 +97,8 @@ module Arel # :nodoc: all
end
alias :== :eql?
def type_cast_for_database(attribute_name, value)
type_caster.type_cast_for_database(attribute_name, value)
def type_cast_for_database(attr_name, value)
type_caster.type_cast_for_database(attr_name, value)
end
def type_for_attribute(name)