Skip to content

Commit 1faa855

Browse files
committed
[Rails51] Remove supports_primary_key and coerce no key test.
* PrimaryKeysTest#test_create_without_primary_key_no_extra_query * PrimaryKeysTest#test_deprecate_supports_primary_key
1 parent 21c39e8 commit 1faa855

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

RAILS5-TODO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
* Remove deprecated tasks: `db:test:clone`, `db:test:clone_schema`, `db:test:clone_structure`.
1919
* Make `table_name=` reset current statement cache,
2020
so queries are not run against the previous table name.
21-
* Deprecate `supports_primary_key?` on connection adapters since it's
22-
been long unused and unsupported.
2321
* Deprecate using `#quoted_id` in quoting.
2422
* Deprecate `supports_migrations?` on connection adapters.
2523
* Dig moving `Column#sqlserver_options` to `sql_type_metadata` delegate.

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ def supports_migrations?
7777
true
7878
end
7979

80-
def supports_primary_key?
81-
true
82-
end
83-
8480
def supports_ddl_transactions?
8581
true
8682
end

test/cases/coerced_tests.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,15 @@ def test_registering_new_handlers_coerced
593593

594594

595595

596+
class PrimaryKeysTest < ActiveRecord::TestCase
597+
# Gonna trust Rails core for this. We end up with 2 querys vs 3 asserted
598+
# but as far as I can tell, this is only one for us anyway.
599+
coerce_tests! :test_create_without_primary_key_no_extra_query
600+
end
601+
602+
603+
604+
596605
require 'models/task'
597606
class QueryCacheTest < ActiveRecord::TestCase
598607
coerce_tests! :test_cache_does_not_wrap_string_results_in_arrays

0 commit comments

Comments
 (0)