Add attr_accessor for favorited
This commit is contained in:
parent
e295df0fdd
commit
8d9b434d1e
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue