Skip to content

Commit 7bb6208

Browse files
committed
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.
1 parent ac6e654 commit 7bb6208

File tree

1 file changed

+6
-0
lines changed
  • activerecord/lib/active_record/connection_adapters/abstract

1 file changed

+6
-0
lines changed

activerecord/lib/active_record/connection_adapters/abstract/quoting.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ def quote(value, column = nil)
1010
return value.quoted_id if value.respond_to?(:quoted_id)
1111

1212
if column
13+
ActiveSupport::Deprecation.warn(<<-MSG.squish)
14+
Passing a column to `quote` has been deprecated. It is only used
15+
for type casting, which should be handled elsewhere. See
16+
https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
17+
for more information.
18+
MSG
1319
value = column.cast_type.type_cast_for_database(value)
1420
end
1521

0 commit comments

Comments
 (0)