aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-05-06 20:35:14 +0930
committerGitHub <noreply@github.com>2017-05-06 20:35:14 +0930
commite5434b038985906f17b3663766a0588dd8998b17 (patch)
tree735b04ab7f03ed0aca7b6a0dafae9f55809d41bb /activerecord/lib/active_record
parentd69dfdc6d304ca2aef7a08c625f8ca9811e539ca (diff)
parentae73637e35db20d0c4e14959d8c1274e5399278e (diff)
downloadrails-e5434b038985906f17b3663766a0588dd8998b17.tar.gz
rails-e5434b038985906f17b3663766a0588dd8998b17.tar.bz2
rails-e5434b038985906f17b3663766a0588dd8998b17.zip
Merge pull request #28989 from matthewd/quoted_id-deprecation
Clarify deprecation message for #quoted_id
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/quoting.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
index f0c0fbab6c..61233dcc51 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb
@@ -10,8 +10,15 @@ module ActiveRecord
value = id_value_for_database(value) if value.is_a?(Base)
if value.respond_to?(:quoted_id)
+ at = value.method(:quoted_id).source_location
+ at &&= " at %s:%d" % at
+
+ owner = value.method(:quoted_id).owner.to_s
+ klass = value.class.to_s
+ klass += "(#{owner})" unless owner == klass
+
ActiveSupport::Deprecation.warn \
- "Using #quoted_id is deprecated and will be removed in Rails 5.2."
+ "Defining #quoted_id is deprecated and will be ignored in Rails 5.2. (defined on #{klass}#{at})"
return value.quoted_id
end