aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2017-07-18 13:42:57 -0400
committerGitHub <noreply@github.com>2017-07-18 13:42:57 -0400
commit36ff7b63ec083924a5b407cf3df7ae90e22183e2 (patch)
tree8cbdbe138f13a0dc7c3666f036fda685c644d262 /activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
parent425ba83c28214ca97c5d3600c16ad7a796cd33e6 (diff)
parentf47bac481949a69a519ea7d833e1a8d435332d52 (diff)
downloadrails-36ff7b63ec083924a5b407cf3df7ae90e22183e2.tar.gz
rails-36ff7b63ec083924a5b407cf3df7ae90e22183e2.tar.bz2
rails-36ff7b63ec083924a5b407cf3df7ae90e22183e2.zip
Merge branch 'master' into fix_unscope_where_column_with_or
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql/quoting.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql/quoting.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
index d4f5906b33..0cc0ac74fe 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
@@ -39,6 +39,14 @@ module ActiveRecord
def quoted_binary(value)
"x'#{value.hex}'"
end
+
+ def _type_cast(value)
+ case value
+ when Type::Time::Value then value.__getobj__
+ when Date, Time then value
+ else super
+ end
+ end
end
end
end