Add counter_cache flag to GridWeapon

This commit is contained in:
Justin Edmund 2022-03-14 18:20:29 -07:00
parent ff85de2f86
commit 72c144ef65

View file

@ -1,5 +1,6 @@
class GridWeapon < ApplicationRecord
belongs_to :party
belongs_to :party,
counter_cache: :weapons_count
belongs_to :weapon_key1, class_name: 'WeaponKey', foreign_key: :weapon_key1_id, optional: true
belongs_to :weapon_key2, class_name: 'WeaponKey', foreign_key: :weapon_key2_id, optional: true