add covenant

This commit is contained in:
2021-05-30 17:49:54 +02:00
parent d0e5824d40
commit 5b3da08707
29 changed files with 157 additions and 9 deletions

View File

@@ -10,10 +10,12 @@ class WowCharacter < ApplicationRecord
belongs_to :wow_race
belongs_to :wow_character_title, optional: true
belongs_to :wow_guild, optional: true
has_one :wow_covenant_progress, dependent: :destroy
has_one :wow_covenant, through: :wow_covenant_progress
belongs_to :last_position, class_name: 'WowGeoPosition', optional: true
belongs_to :bind_position, class_name: 'WowGeoPosition', optional: true
has_one :wow_character_medium, dependent: :nullify
has_many :wow_standings, dependent: :nullify
has_one :wow_character_medium, dependent: :destroy
has_many :wow_standings, dependent: :destroy
has_many :wow_reputations, through: :wow_standings
validates :name, presence: true