From 7bb620869725ad6de603f6a5393ee17df13aa96c Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sat, 10 Jan 2015 15:45:10 -0700 Subject: [PATCH] Deprecate passing a column to `quote` It's only used to grab the type for type casting purposes, and we would like to remove the type from the columns entirely. --- .../active_record/connection_adapters/abstract/quoting.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index 1f265a55df..7c1a779577 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -10,6 +10,12 @@ def quote(value, column = nil) return value.quoted_id if value.respond_to?(:quoted_id) if column + ActiveSupport::Deprecation.warn(<<-MSG.squish) + Passing a column to `quote` has been deprecated. It is only used + for type casting, which should be handled elsewhere. See + https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11 + for more information. + MSG value = column.cast_type.type_cast_for_database(value) end -- GitLab