add everything to manage reputations
This commit is contained in:
13
app/models/wow_reputation.rb
Normal file
13
app/models/wow_reputation.rb
Normal 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
|
||||
Reference in New Issue
Block a user