We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e98a280 + 448a7b0 commit a381802Copy full SHA for a381802
activerecord/test/cases/persistence_test.rb
@@ -1439,6 +1439,15 @@ def test_primary_key_stays_the_same
1439
assert_equal("id", ClothingItem.primary_key)
1440
end
1441
1442
+ def test_query_constraints_list_is_an_empty_array_if_primary_key_is_nil
1443
+ klass = Class.new(ActiveRecord::Base) do
1444
+ self.table_name = "developers_projects"
1445
+ end
1446
+
1447
+ assert_nil klass.primary_key
1448
+ assert_empty klass.query_constraints_list
1449
1450
1451
def test_query_constraints_uses_primary_key_by_default
1452
post = posts(:welcome)
1453
assert_uses_query_constraints_on_reload(post, "id")
0 commit comments