add WowGuild model
This commit is contained in:
@@ -9,6 +9,7 @@ class WowCharacter < ApplicationRecord
|
||||
belongs_to :wow_class
|
||||
belongs_to :wow_race
|
||||
belongs_to :wow_character_title, optional: true
|
||||
belongs_to :wow_guild, optional: true
|
||||
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
|
||||
|
||||
12
app/models/wow_guild.rb
Normal file
12
app/models/wow_guild.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowGuild < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :translated_faction
|
||||
|
||||
belongs_to :wow_realm
|
||||
has_many :wow_characters, dependent: :nullify
|
||||
|
||||
validates :name, presence: true
|
||||
validates :guild_id, presence: true, uniqueness: true
|
||||
end
|
||||
Reference in New Issue
Block a user