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:
+1
-1
@@ -29,6 +29,6 @@ class Card < ApplicationRecord
|
||||
end
|
||||
|
||||
def cache_key
|
||||
[ super, collection&.name ].compact.join("/")
|
||||
[ super, collection.name ].compact.join("/")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user