Cards have a not-null schema and collections destroy all cards on deletion

This shouldnt be necessary. Maybe remnant of some previous design?
This commit is contained in:
David Heinemeier Hansson
2025-04-21 09:18:42 +02:00
parent 48a6c05250
commit dc2205ee79
2 changed files with 1 additions and 8 deletions
+1 -1
View File
@@ -29,6 +29,6 @@ class Card < ApplicationRecord
end
def cache_key
[ super, collection&.name ].compact.join("/")
[ super, collection.name ].compact.join("/")
end
end
-7
View File
@@ -120,11 +120,4 @@ class CardTest < ActiveSupport::TestCase
assert_includes card.cache_key, ApplicationRecord.current_tenant, "cache key must always include the tenant"
end
test "cache key gracefully handles a nil collection" do
card = cards(:logo)
card.update_column :collection_id, Collection.last.id + 1
assert_nothing_raised { card.reload.cache_key }
end
end