add helper to show if a pet or mount is owned by the user

This commit is contained in:
Etienne Ischer
2021-04-30 12:49:31 +02:00
parent 639bd044bf
commit ca80fd55fa
6 changed files with 11 additions and 3 deletions

View File

@@ -4,8 +4,8 @@ class WowPetAbility < ApplicationRecord
extend Mobility
translates :name, :translated_battle_pet_type
has_many :learned_pet_abilities, dependent: :destroy
has_many :wow_pets, through: :learned_pet_abilities
has_many :learned_wow_pet_abilities, dependent: :destroy
has_many :wow_pets, through: :learned_wow_pet_abilities
validates :name, presence: true
validates :ability_id, presence: true, uniqueness: true