add everything to manage reputations

This commit is contained in:
2021-05-01 00:22:15 +02:00
parent ca80fd55fa
commit d227cdc87c
30 changed files with 366 additions and 43 deletions

View File

@@ -0,0 +1,13 @@
class WowReputation < ApplicationRecord
extend Mobility
translates :name, :description, :translated_faction
has_many :wow_standings, dependent: :destroy
has_many :wow_characters, through: :wow_standings
belongs_to :wow_reputation_tier, optional: true
has_many :sub_wow_reputations, class_name: 'WowReputation', foreign_key: 'meta_wow_reputation_id', dependent: :nullify, inverse_of: :meta_wow_reputation
belongs_to :meta_wow_reputation, class_name: 'WowReputation', optional: true
validates :name, presence: true
validates :reputation_id, presence: true, uniqueness: true
end