diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-01 20:11:40 +0900 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2017-02-12 19:46:47 -0700 |
commit | bb45fa05d1681230764af023058af65142c75cff (patch) | |
tree | 9cee7e74529090bef26c580a665bbf1fdf3a3ce8 /activerecord/lib | |
parent | 416d85b65e4f49f7e86f24c56bc1ec7441e90f2c (diff) | |
download | rails-bb45fa05d1681230764af023058af65142c75cff.tar.gz rails-bb45fa05d1681230764af023058af65142c75cff.tar.bz2 rails-bb45fa05d1681230764af023058af65142c75cff.zip |
Deprecate `supports_primary_key?`
`supports_primary_key?` was added to determine if `primary_key` is
implemented in the adapter in f060221. But we already use `primary_key`
without `supports_primary_key?` (207f266, 5f3cf42) and using
`supports_primary_key?` has been removed in #1318. This means that
`supports_primary_key?` is no longer used in the internal and Active
Record doesn't work without `primary_key` is implemented (all adapters
must implement `primary_key`).
Closes #27977
Diffstat (limited to 'activerecord/lib')
4 files changed, 3 insertions, 17 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index ae24ce7236..808de5daca 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -236,11 +236,10 @@ module ActiveRecord false end - # Can this adapter determine the primary key for tables not attached - # to an Active Record class, such as join tables? - def supports_primary_key? - false + def supports_primary_key? # :nodoc: + true end + deprecate :supports_primary_key? # Does this adapter support DDL rollbacks in transactions? That is, would # CREATE TABLE or ALTER TABLE get rolled back by a transaction? diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 279c232144..f743c80372 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -93,10 +93,6 @@ module ActiveRecord true end - def supports_primary_key? - true - end - def supports_bulk_alter? #:nodoc: true end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 6b1e870a31..203566c91b 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -282,11 +282,6 @@ module ActiveRecord true end - # Does PostgreSQL support finding primary key on non-Active Record tables? - def supports_primary_key? #:nodoc: - true - end - def set_standard_conforming_strings execute("SET standard_conforming_strings = on", "SCHEMA") end diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index 3d728d74cf..16ef195bfc 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -122,10 +122,6 @@ module ActiveRecord true end - def supports_primary_key? #:nodoc: - true - end - def requires_reloading? true end |