diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-01 19:59:17 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-24 06:56:06 +0900 |
commit | d15527800fbc199b969019c665226f836d8fedce (patch) | |
tree | b654c648b30a1e70e463fc7b5652183ab9a094cf /activerecord/lib | |
parent | a5586126d179ad89bf48dd09fb4c8d98be3a841c (diff) | |
download | rails-d15527800fbc199b969019c665226f836d8fedce.tar.gz rails-d15527800fbc199b969019c665226f836d8fedce.tar.bz2 rails-d15527800fbc199b969019c665226f836d8fedce.zip |
Deprecate using `#quoted_id` in quoting
Originally `quoted_id` was used in legacy quoting mechanism. Now we use
type casting mechanism for that. Let's deprecate `quoted_id`.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index a99b58f41c..e5a24b2aca 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -10,6 +10,8 @@ module ActiveRecord value = id_value_for_database(value) if value.is_a?(Base) if value.respond_to?(:quoted_id) + ActiveSupport::Deprecation.warn \ + "Using #quoted_id is deprecated and will be removed in Rails 5.2." return value.quoted_id end diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index 427c0019c6..64bda1539c 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -1,4 +1,3 @@ - module ActiveRecord module Sanitization extend ActiveSupport::Concern @@ -207,9 +206,9 @@ module ActiveRecord end end - # TODO: Deprecate this def quoted_id # :nodoc: self.class.connection.quote(@attributes[self.class.primary_key].value_for_database) end + deprecate :quoted_id end end |