aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-10 15:45:10 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-10 15:45:47 -0700
commit7bb620869725ad6de603f6a5393ee17df13aa96c (patch)
tree4e20c1c77a1ebbe04e9bb605b5b77a4787e4cf77 /activerecord/lib/active_record/connection_adapters
parentac6e6545de378cbd86c854884806b46f6fd33247 (diff)
downloadrails-7bb620869725ad6de603f6a5393ee17df13aa96c.tar.gz
rails-7bb620869725ad6de603f6a5393ee17df13aa96c.tar.bz2
rails-7bb620869725ad6de603f6a5393ee17df13aa96c.zip
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.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/quoting.rb6
1 files changed, 6 insertions, 0 deletions
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 @@ module ActiveRecord
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