Add attr_accessor for favorited

This commit is contained in:
Justin Edmund 2022-02-27 22:27:10 -08:00
parent e295df0fdd
commit 8d9b434d1e

View file

@ -8,6 +8,8 @@ class Party < ApplicationRecord
has_many :weapons, foreign_key: "party_id", class_name: "GridWeapon", dependent: :destroy
has_many :summons, foreign_key: "party_id", class_name: "GridSummon", dependent: :destroy
attr_accessor :favorited
def is_favorited(user)
user.favorite_parties.include? self
end