add some test and things
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RpWorldsController < ApplicationController
|
||||
before_action :set_rp_world, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
|
||||
@@ -2,11 +2,24 @@
|
||||
|
||||
class WowCharactersController < ProtectedController
|
||||
def index
|
||||
@wow_characters = current_user.wow_characters.includes(:wow_realm, :wow_race, :wow_class, :wow_character_medium, :wow_guild, :wow_covenant)
|
||||
@wow_characters = current_user.wow_characters.includes(
|
||||
:wow_realm,
|
||||
:wow_race,
|
||||
:wow_class,
|
||||
:wow_character_medium,
|
||||
:wow_guild,
|
||||
:wow_covenant
|
||||
)
|
||||
end
|
||||
|
||||
def show
|
||||
@wow_character = current_user.wow_characters.includes(wow_standings: { wow_reputation: { wow_reputation_tier: :wow_reputation_tier_levels } }).find(params[:id])
|
||||
@wow_character = current_user.wow_characters.includes(
|
||||
wow_standings: {
|
||||
wow_reputation: {
|
||||
wow_reputation_tier: :wow_reputation_tier_levels
|
||||
}
|
||||
}
|
||||
).find(params[:id])
|
||||
meta_reputation_ids = @wow_character.wow_standings.map { |standing| standing.wow_reputation.meta_wow_reputation_id }.uniq
|
||||
@meta_wow_reputations = WowReputation.find(meta_reputation_ids)
|
||||
end
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module RpWorldHelper
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RpWorld < ApplicationRecord
|
||||
belongs_to :user
|
||||
alias_attribute :owner, :user
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowCharacterPlayRpWorld < ApplicationRecord
|
||||
belongs_to :wow_character
|
||||
belongs_to :rp_world
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowCovenant < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name, :description
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowCovenantProgress < ApplicationRecord
|
||||
belongs_to :wow_character
|
||||
belongs_to :wow_covenant
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowCreature < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowCreatureFamily < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowCreatureType < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowItem < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowItemClass < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowItemInventoryType < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowItemQuality < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowItemSubClass < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :display_name, :verbose_name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WowSpell < ApplicationRecord
|
||||
extend Mobility
|
||||
translates :name, :description
|
||||
|
||||
@@ -6,7 +6,7 @@ class WowCharacterPositionsWorker < WowSidekiqWorker
|
||||
|
||||
# Protected data
|
||||
RBattlenet.set_options(locale: 'all')
|
||||
params = {
|
||||
params = {
|
||||
character_id: wow_character_id,
|
||||
realm_id: wow_character.wow_realm.realm_id,
|
||||
token: wow_character.user.token
|
||||
|
||||
Reference in New Issue
Block a user