# frozen_string_literal: true class WowCharacter < ApplicationRecord extend Mobility translates :translated_faction, :translated_gender belongs_to :user belongs_to :wow_realm belongs_to :wow_class 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: :destroy has_many :wow_standings, dependent: :destroy has_many :wow_reputations, through: :wow_standings has_many :wow_character_play_rp_worlds, dependent: :destroy has_many :rp_worlds, through: :wow_character_play_rp_worlds has_many :completed_wow_achievements, dependent: :destroy has_many :wow_achievements, through: :completed_wow_achievements has_many :completed_wow_achievement_criteria, dependent: :destroy has_many :wow_achievement_criteria, through: :completed_wow_achievement_criteria validates :name, presence: true validates :character_id, presence: true, uniqueness: true end