Add counter caches to party

This commit is contained in:
Justin Edmund 2025-02-07 01:54:27 -08:00
parent b86f3a90f6
commit bd53af4339

View file

@ -60,18 +60,21 @@ class Party < ApplicationRecord
has_many :characters,
foreign_key: 'party_id',
class_name: 'GridCharacter',
counter_cache: true,
dependent: :destroy,
inverse_of: :party
has_many :weapons,
foreign_key: 'party_id',
class_name: 'GridWeapon',
counter_cache: true,
dependent: :destroy,
inverse_of: :party
has_many :summons,
foreign_key: 'party_id',
class_name: 'GridSummon',
counter_cache: true,
dependent: :destroy,
inverse_of: :party