diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-07-17 17:46:07 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-10-23 12:50:45 -0400 |
commit | 82472b3922bda2f337a79cef961b4760d04f9689 (patch) | |
tree | c332466ace0be6e46ca706271f18342897cce7e1 /activerecord/lib | |
parent | 48766e32d31651606b9f68a16015ad05c3b0de2c (diff) | |
download | rails-82472b3922bda2f337a79cef961b4760d04f9689.tar.gz rails-82472b3922bda2f337a79cef961b4760d04f9689.tar.bz2 rails-82472b3922bda2f337a79cef961b4760d04f9689.zip |
Remove deprecated support to `quoted_id` when typecasting an Active Record object
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 17 | ||||
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 5 |
2 files changed, 0 insertions, 22 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index 9ad04c3216..92e46ccf9f 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -11,19 +11,6 @@ module ActiveRecord def quote(value) 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 \ - "Defining #quoted_id is deprecated and will be ignored in Rails 5.2. (defined on #{klass}#{at})" - return value.quoted_id - end - if value.respond_to?(:value_for_database) value = value.value_for_database end @@ -37,10 +24,6 @@ module ActiveRecord def type_cast(value, column = nil) value = id_value_for_database(value) if value.is_a?(Base) - if value.respond_to?(:quoted_id) && value.respond_to?(:id) - return value.id - end - if column value = type_cast_from_column(column, value) end diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index 91a4f1fad6..3482d32059 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -207,10 +207,5 @@ module ActiveRecord end end end - - def quoted_id # :nodoc: - self.class.connection.quote(@attributes[self.class.primary_key].value_for_database) - end - deprecate :quoted_id end end |