diff --git a/Gemfile b/Gemfile
index 57714c1..4654550 100644
--- a/Gemfile
+++ b/Gemfile
@@ -35,7 +35,7 @@ gem 'omniauth-bnet', '~> 2.0.0'
# This gem provides a mitigation against CVE-2015-9284
gem 'omniauth-rails_csrf_protection', '~> 0.1.2'
# A Ruby wrapper around Blizzard's Game Data and Profile APIs
-gem 'rbattlenet', '~> 2.2.7', git: 'https://github.com/Dainii/rbattlenet'
+gem 'rbattlenet', '~> 2.2.9', git: 'https://github.com/Dainii/rbattlenet'
# A gem that provides Rails integration for the Sentry error logger
gem 'sentry-rails', '~> 4.4.0'
gem 'sentry-ruby', '~> 4.4.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index d5d8d0e..f4d34d9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,8 +1,8 @@
GIT
remote: https://github.com/Dainii/rbattlenet
- revision: 6fc990a743b1cec56e95820aec9222b5ff2e843a
+ revision: a0492dd16f9b29b61e364009272d60e9201e1337
specs:
- rbattlenet (2.2.7)
+ rbattlenet (2.2.9)
require_all
typhoeus (~> 1.1)
@@ -163,7 +163,7 @@ GEM
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.7)
- nokogiri (1.11.3-x86_64-linux)
+ nokogiri (1.11.6-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.7)
faraday (>= 0.8, < 2.0)
@@ -186,7 +186,7 @@ GEM
orm_adapter (0.5.0)
pagy (4.3.0)
parallel (1.20.1)
- parser (3.0.1.0)
+ parser (3.0.1.1)
ast (~> 2.4.1)
pg (1.2.3)
pry (0.14.1)
@@ -272,17 +272,17 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.2)
- rubocop (1.13.0)
+ rubocop (1.16.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
- rubocop-ast (>= 1.2.0, < 2.0)
+ rubocop-ast (>= 1.7.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
- rubocop-ast (1.4.1)
- parser (>= 2.7.1.5)
+ rubocop-ast (1.7.0)
+ parser (>= 3.0.1.1)
rubocop-performance (1.11.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
@@ -329,7 +329,7 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2)
- solargraph (0.40.4)
+ solargraph (0.41.1)
backport (~> 1.1)
benchmark
bundler (>= 1.17.2)
@@ -411,7 +411,7 @@ DEPENDENCIES
rails (~> 6.1.3, >= 6.1.3.1)
rails-erd
rails-i18n (~> 6.0.0)
- rbattlenet (~> 2.2.7)!
+ rbattlenet (~> 2.2.9)!
redis (~> 4.2.5)
rspec-rails
rubocop
diff --git a/app/assets/stylesheets/rp_world.scss b/app/assets/stylesheets/rp_world.scss
new file mode 100644
index 0000000..c68ad24
--- /dev/null
+++ b/app/assets/stylesheets/rp_world.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the RpWorld controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: https://sass-lang.com/
diff --git a/app/controllers/rp_worlds_controller.rb b/app/controllers/rp_worlds_controller.rb
new file mode 100644
index 0000000..ed5eef5
--- /dev/null
+++ b/app/controllers/rp_worlds_controller.rb
@@ -0,0 +1,9 @@
+class RpWorldsController < ApplicationController
+ def index
+ @rp_worlds = RpWorld.all
+ end
+
+ def show
+ @rp_world = RpWorld.includes(:wow_characters).find(params[:id])
+ end
+end
diff --git a/app/helpers/rp_world_helper.rb b/app/helpers/rp_world_helper.rb
new file mode 100644
index 0000000..1e02379
--- /dev/null
+++ b/app/helpers/rp_world_helper.rb
@@ -0,0 +1,2 @@
+module RpWorldHelper
+end
diff --git a/app/models/rp_world.rb b/app/models/rp_world.rb
new file mode 100644
index 0000000..f600e52
--- /dev/null
+++ b/app/models/rp_world.rb
@@ -0,0 +1,9 @@
+class RpWorld < ApplicationRecord
+ belongs_to :user
+ alias_attribute :owner, :user
+ has_many :wow_character_play_rp_worlds, dependent: :destroy
+ has_many :wow_characters, through: :wow_character_play_rp_worlds
+ alias_attribute :members, :wow_characters
+
+ validates :name, presence: true
+end
diff --git a/app/models/wow_character.rb b/app/models/wow_character.rb
index fce4562..c5423c4 100644
--- a/app/models/wow_character.rb
+++ b/app/models/wow_character.rb
@@ -17,6 +17,8 @@ class WowCharacter < ApplicationRecord
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
validates :name, presence: true
validates :character_id, presence: true, uniqueness: true
diff --git a/app/models/wow_character_play_rp_world.rb b/app/models/wow_character_play_rp_world.rb
new file mode 100644
index 0000000..0c4742c
--- /dev/null
+++ b/app/models/wow_character_play_rp_world.rb
@@ -0,0 +1,7 @@
+class WowCharacterPlayRpWorld < ApplicationRecord
+ belongs_to :wow_character
+ belongs_to :rp_world
+
+ validates :status, presence: true, format: { with: /(INVITED|PENDING|PLAYING|BANNED)/ }
+ validates :role, presence: true, format: { with: /(PLAYER|MODERATOR|ADMIN)/ }
+end
diff --git a/app/models/wow_creature.rb b/app/models/wow_creature.rb
new file mode 100644
index 0000000..4486363
--- /dev/null
+++ b/app/models/wow_creature.rb
@@ -0,0 +1,10 @@
+class WowCreature < ApplicationRecord
+ extend Mobility
+ translates :name
+
+ belongs_to :wow_creature_family, optional: true
+ belongs_to :wow_creature_type, optional: true
+
+ validates :name, presence: true
+ validates :creature_id, presence: true, uniqueness: true
+end
diff --git a/app/models/wow_creature_family.rb b/app/models/wow_creature_family.rb
new file mode 100644
index 0000000..176d449
--- /dev/null
+++ b/app/models/wow_creature_family.rb
@@ -0,0 +1,9 @@
+class WowCreatureFamily < ApplicationRecord
+ extend Mobility
+ translates :name
+
+ has_many :wow_creatures, dependent: :destroy
+
+ validates :name, presence: true
+ validates :creature_family_id, presence: true, uniqueness: true
+end
diff --git a/app/models/wow_creature_type.rb b/app/models/wow_creature_type.rb
new file mode 100644
index 0000000..e97ff9b
--- /dev/null
+++ b/app/models/wow_creature_type.rb
@@ -0,0 +1,9 @@
+class WowCreatureType < ApplicationRecord
+ extend Mobility
+ translates :name
+
+ has_many :wow_creatures, dependent: :destroy
+
+ validates :name, presence: true
+ validates :creature_type_id, presence: true, uniqueness: true
+end
diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb
index a13854b..8e82f63 100644
--- a/app/views/layouts/_navbar.html.erb
+++ b/app/views/layouts/_navbar.html.erb
@@ -16,6 +16,9 @@
<%= t('layouts.navbar.reputations') %>
+
+ <%= t('layouts.navbar.worlds') %>
+
<%= render 'layouts/locales' %>
diff --git a/app/views/rp_worlds/index.html.erb b/app/views/rp_worlds/index.html.erb
new file mode 100644
index 0000000..a9e485c
--- /dev/null
+++ b/app/views/rp_worlds/index.html.erb
@@ -0,0 +1,18 @@
+Characters list
+
+
+
+
+ | <%= t('rp_worlds.world_list.name') %> |
+ <%= t('rp_worlds.world_list.description') %> |
+
+
+
+ <% @rp_worlds.each do |world| %>
+
+ | <%= link_to world.name, world %> |
+ <%= world.description %> |
+
+ <% end %>
+
+
diff --git a/app/views/rp_worlds/show.html.erb b/app/views/rp_worlds/show.html.erb
new file mode 100644
index 0000000..6591874
--- /dev/null
+++ b/app/views/rp_worlds/show.html.erb
@@ -0,0 +1,17 @@
+
+
+
+
+
<%= @rp_world.name %>
+
Description: <%= @rp_world.description %>
+
Membres:
+ <% @rp_world.wow_characters.each do |member| %>
+
<%= link_to member.name, member %>
+ <% end %>
+
+
+
+
+
Suite...
+
+
diff --git a/app/workers/wow_creature_families_worker.rb b/app/workers/wow_creature_families_worker.rb
new file mode 100644
index 0000000..b6df612
--- /dev/null
+++ b/app/workers/wow_creature_families_worker.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class WowCreatureFamiliesWorker < WowSidekiqWorker
+ def perform
+ RBattlenet.authenticate(client_id: ENV['BLIZZARD_API_CLIENT_ID'], client_secret: ENV['BLIZZARD_API_CLIENT_SECRET'])
+ RBattlenet.set_options(locale: 'all')
+ result = RBattlenet::Wow::CreatureFamily.all
+
+ return unless result.status_code == 200
+
+ result.creature_families.each do |creature_family|
+ wow_creature_family = WowCreatureFamily.find_or_initialize_by(creature_family_id: creature_family.id)
+
+ # Localisation data
+ locales.each do |locale|
+ Mobility.with_locale(locale[0]) { wow_creature_family.name = creature_family.name[locale[1]] }
+ end
+
+ wow_creature_family.save
+ end
+ end
+end
diff --git a/app/workers/wow_creature_types_worker.rb b/app/workers/wow_creature_types_worker.rb
new file mode 100644
index 0000000..75ed703
--- /dev/null
+++ b/app/workers/wow_creature_types_worker.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class WowCreatureTypesWorker < WowSidekiqWorker
+ def perform
+ RBattlenet.authenticate(client_id: ENV['BLIZZARD_API_CLIENT_ID'], client_secret: ENV['BLIZZARD_API_CLIENT_SECRET'])
+ RBattlenet.set_options(locale: 'all')
+ result = RBattlenet::Wow::CreatureType.all
+
+ return unless result.status_code == 200
+
+ result.creature_types.each do |creature_type|
+ wow_creature_type = WowCreatureType.find_or_initialize_by(creature_type_id: creature_type.id)
+
+ # Localisation data
+ locales.each do |locale|
+ Mobility.with_locale(locale[0]) { wow_creature_type.name = creature_type.name[locale[1]] }
+ end
+
+ wow_creature_type.save
+ end
+ end
+end
diff --git a/app/workers/wow_creatures_worker.rb b/app/workers/wow_creatures_worker.rb
new file mode 100644
index 0000000..fb1d1e2
--- /dev/null
+++ b/app/workers/wow_creatures_worker.rb
@@ -0,0 +1,42 @@
+# frozen_string_literal: true
+
+class WowCreaturesWorker < WowSidekiqWorker
+ def perform(creature_id, batch_size, keep_going_on)
+ RBattlenet.authenticate(client_id: ENV['BLIZZARD_API_CLIENT_ID'], client_secret: ENV['BLIZZARD_API_CLIENT_SECRET'])
+ RBattlenet.set_options(locale: 'all')
+
+ params = {
+ _page: 1,
+ _pageSize: batch_size,
+ orderby: 'id',
+ filters: { id: "[#{creature_id},]" }
+ }
+ result = RBattlenet::Wow::Search::Creature.find(params)
+
+ return unless result.status_code == 200
+
+ result.results&.each do |creature|
+ wow_creature = WowCreature.find_or_initialize_by(creature_id: creature.data.id)
+
+ wow_creature.display_id = creature.data.creature_displays&.first&.id
+ wow_creature.is_tameable = creature.data&.is_tameable
+
+ wow_creature.wow_creature_family = WowCreatureFamily.find_by(creature_family_id: creature.data.family.id) if creature.data.family
+ wow_creature.wow_creature_type = WowCreatureType.find_by(creature_type_id: creature.data.type.id) if creature.data.type
+
+ # Localisation data
+ locales.each do |locale|
+ Mobility.with_locale(locale[0]) do
+ wow_creature.name = creature.data.name[locale[1]]
+ end
+ end
+
+ wow_creature.save
+ end
+
+ # Create a new job for the next batch if keep_going_on is true
+ return unless keep_going_on && !result.results.count.zero?
+
+ WowCreaturesWorker.perform_async(result.results.last.data.id + 1, batch_size, keep_going_on)
+ end
+end
diff --git a/config/locales/layouts/de-de.yml b/config/locales/layouts/de-de.yml
index 2353b93..19a14d5 100644
--- a/config/locales/layouts/de-de.yml
+++ b/config/locales/layouts/de-de.yml
@@ -5,3 +5,4 @@ de-de:
mounts: "Anschlüsse"
pets: "Maskottchen"
reputations: "Reputationen"
+ worlds: "Rollenspielwelten"
diff --git a/config/locales/layouts/en-gb.yml b/config/locales/layouts/en-gb.yml
index 9fa5654..c4ca048 100644
--- a/config/locales/layouts/en-gb.yml
+++ b/config/locales/layouts/en-gb.yml
@@ -5,3 +5,4 @@ en-gb:
mounts: "Mounts"
pets: "Pets"
reputations: "Reputations"
+ worlds: "Roleplay Worlds"
diff --git a/config/locales/layouts/en-us.yml b/config/locales/layouts/en-us.yml
index ead98ca..09bb64a 100644
--- a/config/locales/layouts/en-us.yml
+++ b/config/locales/layouts/en-us.yml
@@ -5,3 +5,4 @@ en-us:
mounts: "Mounts"
pets: "Pets"
reputations: "Reputations"
+ worlds: "Roleplay Worlds"
diff --git a/config/locales/layouts/es-es.yml b/config/locales/layouts/es-es.yml
index 9f16f18..06d9b31 100644
--- a/config/locales/layouts/es-es.yml
+++ b/config/locales/layouts/es-es.yml
@@ -5,3 +5,4 @@ es-es:
mounts: "Montajes"
pets: "Mascotas"
reputations: "Reputaciones"
+ worlds: "Mundos de juegos de rol"
diff --git a/config/locales/layouts/es-mx.yml b/config/locales/layouts/es-mx.yml
index 8ad6fec..b8f8983 100644
--- a/config/locales/layouts/es-mx.yml
+++ b/config/locales/layouts/es-mx.yml
@@ -5,3 +5,4 @@ es-mx:
mounts: "Montajes"
pets: "Mascotas"
reputations: "Reputaciones"
+ worlds: "Mundos de juegos de rol"
diff --git a/config/locales/layouts/fr-fr.yml b/config/locales/layouts/fr-fr.yml
index 942307a..f8220cd 100644
--- a/config/locales/layouts/fr-fr.yml
+++ b/config/locales/layouts/fr-fr.yml
@@ -5,3 +5,4 @@ fr-fr:
mounts: "Montures"
pets: "Mascottes"
reputations: "Réputations"
+ worlds: "Mondes de jeu de rôle"
diff --git a/config/locales/layouts/it.yml b/config/locales/layouts/it.yml
index 32ade89..3930536 100644
--- a/config/locales/layouts/it.yml
+++ b/config/locales/layouts/it.yml
@@ -5,3 +5,4 @@ it:
mounts: "Monti"
pets: "Mascotti"
reputations: "Reputazioni"
+ worlds: "Mondi di gioco di ruolo"
diff --git a/config/locales/layouts/ko.yml b/config/locales/layouts/ko.yml
index 74ace13..9d6155f 100644
--- a/config/locales/layouts/ko.yml
+++ b/config/locales/layouts/ko.yml
@@ -5,3 +5,4 @@ ko:
mounts: "마운트"
pets: "마스코트"
reputations: "평판"
+ worlds: "롤 플레이 세계"
diff --git a/config/locales/layouts/pt-br.yml b/config/locales/layouts/pt-br.yml
index 4689f87..5047429 100644
--- a/config/locales/layouts/pt-br.yml
+++ b/config/locales/layouts/pt-br.yml
@@ -5,3 +5,4 @@ pt-br:
mounts: "Montagens"
pets: "Mascote"
reputations: "Reputações"
+ worlds: "Mundos de RPG"
diff --git a/config/locales/layouts/ru-ru.yml b/config/locales/layouts/ru-ru.yml
index e392ed2..91a4b2e 100644
--- a/config/locales/layouts/ru-ru.yml
+++ b/config/locales/layouts/ru-ru.yml
@@ -5,3 +5,4 @@ ru-ru:
mounts: "Крепления"
pets: "Талисман"
reputations: "Репутации"
+ worlds: "Ролевые миры"
diff --git a/config/locales/layouts/zh-cn.yml b/config/locales/layouts/zh-cn.yml
index 5eb413a..db4662a 100644
--- a/config/locales/layouts/zh-cn.yml
+++ b/config/locales/layouts/zh-cn.yml
@@ -5,3 +5,4 @@ zh-cn:
mounts: "坐骑"
pets: "吉祥物"
reputations: "名声"
+ worlds: "角色扮演世界"
diff --git a/config/locales/layouts/zh-tw.yml b/config/locales/layouts/zh-tw.yml
index 40a4845..51b9581 100644
--- a/config/locales/layouts/zh-tw.yml
+++ b/config/locales/layouts/zh-tw.yml
@@ -5,3 +5,4 @@ zh-tw:
mounts: "坐骑"
pets: "吉祥物"
reputations: "名声"
+ worlds: "角色扮演世界"
diff --git a/config/locales/rp_worlds/de-de.yml b/config/locales/rp_worlds/de-de.yml
new file mode 100644
index 0000000..ce6375f
--- /dev/null
+++ b/config/locales/rp_worlds/de-de.yml
@@ -0,0 +1,5 @@
+de-de:
+ rp_worlds:
+ world_list:
+ name: "Name"
+ description: "Beschreibung"
diff --git a/config/locales/rp_worlds/en-gb.yml b/config/locales/rp_worlds/en-gb.yml
new file mode 100644
index 0000000..31cbaec
--- /dev/null
+++ b/config/locales/rp_worlds/en-gb.yml
@@ -0,0 +1,5 @@
+en-gb:
+ rp_worlds:
+ world_list:
+ name: "Name"
+ description: "Description"
diff --git a/config/locales/rp_worlds/en-us.yml b/config/locales/rp_worlds/en-us.yml
new file mode 100644
index 0000000..31cbaec
--- /dev/null
+++ b/config/locales/rp_worlds/en-us.yml
@@ -0,0 +1,5 @@
+en-gb:
+ rp_worlds:
+ world_list:
+ name: "Name"
+ description: "Description"
diff --git a/config/locales/rp_worlds/es-es.yml b/config/locales/rp_worlds/es-es.yml
new file mode 100644
index 0000000..35a31de
--- /dev/null
+++ b/config/locales/rp_worlds/es-es.yml
@@ -0,0 +1,5 @@
+es-es:
+ rp_worlds:
+ world_list:
+ name: "Nombre"
+ description: "Descripción"
diff --git a/config/locales/rp_worlds/es-mx.yml b/config/locales/rp_worlds/es-mx.yml
new file mode 100644
index 0000000..110434b
--- /dev/null
+++ b/config/locales/rp_worlds/es-mx.yml
@@ -0,0 +1,5 @@
+es-mx:
+ rp_worlds:
+ world_list:
+ name: "Nombre"
+ description: "Descripción"
diff --git a/config/locales/rp_worlds/fr-fr.yml b/config/locales/rp_worlds/fr-fr.yml
new file mode 100644
index 0000000..6f8a838
--- /dev/null
+++ b/config/locales/rp_worlds/fr-fr.yml
@@ -0,0 +1,5 @@
+en-gb:
+ rp_worlds:
+ world_list:
+ name: "Nom"
+ description: "Description"
diff --git a/config/locales/rp_worlds/it.yml b/config/locales/rp_worlds/it.yml
new file mode 100644
index 0000000..3f7d018
--- /dev/null
+++ b/config/locales/rp_worlds/it.yml
@@ -0,0 +1,5 @@
+it:
+ rp_worlds:
+ world_list:
+ name: "Nome"
+ description: "Descrizione"
diff --git a/config/locales/rp_worlds/ko.yml b/config/locales/rp_worlds/ko.yml
new file mode 100644
index 0000000..6cb4809
--- /dev/null
+++ b/config/locales/rp_worlds/ko.yml
@@ -0,0 +1,5 @@
+ko:
+ rp_worlds:
+ world_list:
+ name: "이름"
+ description: "기술"
diff --git a/config/locales/rp_worlds/pt-br.yml b/config/locales/rp_worlds/pt-br.yml
new file mode 100644
index 0000000..41b7945
--- /dev/null
+++ b/config/locales/rp_worlds/pt-br.yml
@@ -0,0 +1,5 @@
+pt-br:
+ rp_worlds:
+ world_list:
+ name: "Sobrenome"
+ description: "Descrição"
diff --git a/config/locales/rp_worlds/ru-ru.yml b/config/locales/rp_worlds/ru-ru.yml
new file mode 100644
index 0000000..8ea9092
--- /dev/null
+++ b/config/locales/rp_worlds/ru-ru.yml
@@ -0,0 +1,5 @@
+ru-ru:
+ rp_worlds:
+ world_list:
+ name: "Фамилия"
+ description: "Описание"
diff --git a/config/locales/rp_worlds/zh-cn.yml b/config/locales/rp_worlds/zh-cn.yml
new file mode 100644
index 0000000..05abfe8
--- /dev/null
+++ b/config/locales/rp_worlds/zh-cn.yml
@@ -0,0 +1,5 @@
+zh-cn:
+ rp_worlds:
+ world_list:
+ name: "姓"
+ description: "描述"
diff --git a/config/locales/rp_worlds/zh-tw.yml b/config/locales/rp_worlds/zh-tw.yml
new file mode 100644
index 0000000..5f38f63
--- /dev/null
+++ b/config/locales/rp_worlds/zh-tw.yml
@@ -0,0 +1,5 @@
+zh-tw:
+ rp_worlds:
+ world_list:
+ name: "姓"
+ description: "描述"
diff --git a/config/locales/wow_mounts/fr-fr.yml b/config/locales/wow_mounts/fr-fr.yml
index c1ffe14..c7d3e7c 100644
--- a/config/locales/wow_mounts/fr-fr.yml
+++ b/config/locales/wow_mounts/fr-fr.yml
@@ -1,4 +1,4 @@
-en-gb:
+fr-fr:
wow_mounts:
mount_list:
name: "Nom"
diff --git a/config/routes.rb b/config/routes.rb
index 9741e98..618e185 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -14,5 +14,6 @@ Rails.application.routes.draw do
resources :wow_mounts, only: [:index, :show]
resources :wow_pets, only: [:index, :show]
resources :wow_reputations, only: [:index, :show]
+ resources :rp_worlds, only: [:index, :show]
end
end
diff --git a/db/migrate/20210602152828_create_rp_worlds.rb b/db/migrate/20210602152828_create_rp_worlds.rb
new file mode 100644
index 0000000..19484ff
--- /dev/null
+++ b/db/migrate/20210602152828_create_rp_worlds.rb
@@ -0,0 +1,11 @@
+class CreateRpWorlds < ActiveRecord::Migration[6.1]
+ def change
+ create_table :rp_worlds do |t|
+ t.string :name
+ t.string :description
+ t.belongs_to :user
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20210602153013_create_wow_character_play_rp_worlds.rb b/db/migrate/20210602153013_create_wow_character_play_rp_worlds.rb
new file mode 100644
index 0000000..dcf1599
--- /dev/null
+++ b/db/migrate/20210602153013_create_wow_character_play_rp_worlds.rb
@@ -0,0 +1,12 @@
+class CreateWowCharacterPlayRpWorlds < ActiveRecord::Migration[6.1]
+ def change
+ create_table :wow_character_play_rp_worlds do |t|
+ t.string :status
+ t.string :role
+ t.belongs_to :wow_character
+ t.belongs_to :rp_world
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20210602192708_create_wow_creature_families.rb b/db/migrate/20210602192708_create_wow_creature_families.rb
new file mode 100644
index 0000000..cfc33d8
--- /dev/null
+++ b/db/migrate/20210602192708_create_wow_creature_families.rb
@@ -0,0 +1,13 @@
+class CreateWowCreatureFamilies < ActiveRecord::Migration[6.1]
+ def change
+ create_table :wow_creature_families do |t|
+ t.integer :creature_family_id
+ t.jsonb :name
+ t.integer :media_id
+
+ t.timestamps
+ end
+
+ add_index :wow_creature_families, :creature_family_id, unique: true
+ end
+end
diff --git a/db/migrate/20210602192916_create_wow_creature_types.rb b/db/migrate/20210602192916_create_wow_creature_types.rb
new file mode 100644
index 0000000..339263d
--- /dev/null
+++ b/db/migrate/20210602192916_create_wow_creature_types.rb
@@ -0,0 +1,12 @@
+class CreateWowCreatureTypes < ActiveRecord::Migration[6.1]
+ def change
+ create_table :wow_creature_types do |t|
+ t.integer :creature_type_id
+ t.jsonb :name
+
+ t.timestamps
+ end
+
+ add_index :wow_creature_types, :creature_type_id, unique: true
+ end
+end
diff --git a/db/migrate/20210602193023_create_wow_creatures.rb b/db/migrate/20210602193023_create_wow_creatures.rb
new file mode 100644
index 0000000..48b304f
--- /dev/null
+++ b/db/migrate/20210602193023_create_wow_creatures.rb
@@ -0,0 +1,16 @@
+class CreateWowCreatures < ActiveRecord::Migration[6.1]
+ def change
+ create_table :wow_creatures do |t|
+ t.integer :creature_id
+ t.jsonb :name
+ t.boolean :is_tameable
+ t.integer :display_id
+ t.belongs_to :wow_creature_family
+ t.belongs_to :wow_creature_type
+
+ t.timestamps
+ end
+
+ add_index :wow_creatures, :creature_id, unique: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index d605549..d41034b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_05_30_151735) do
+ActiveRecord::Schema.define(version: 2021_06_02_193023) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -49,6 +49,15 @@ ActiveRecord::Schema.define(version: 2021_05_30_151735) do
t.index ["translatable_id", "translatable_type", "locale", "key"], name: "index_mobility_text_translations_on_keys", unique: true
end
+ create_table "rp_worlds", force: :cascade do |t|
+ t.string "name"
+ t.string "description"
+ t.bigint "user_id"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["user_id"], name: "index_rp_worlds_on_user_id"
+ end
+
create_table "user_obtain_wow_mounts", force: :cascade do |t|
t.bigint "user_id"
t.bigint "wow_mount_id"
@@ -95,6 +104,17 @@ ActiveRecord::Schema.define(version: 2021_05_30_151735) do
t.index ["wow_character_id"], name: "index_wow_character_media_on_wow_character_id"
end
+ create_table "wow_character_play_rp_worlds", force: :cascade do |t|
+ t.string "status"
+ t.string "role"
+ t.bigint "wow_character_id"
+ t.bigint "rp_world_id"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["rp_world_id"], name: "index_wow_character_play_rp_worlds_on_rp_world_id"
+ t.index ["wow_character_id"], name: "index_wow_character_play_rp_worlds_on_wow_character_id"
+ end
+
create_table "wow_character_titles", force: :cascade do |t|
t.jsonb "name"
t.string "href"
@@ -171,6 +191,37 @@ ActiveRecord::Schema.define(version: 2021_05_30_151735) do
t.index ["covenant_id"], name: "index_wow_covenants_on_covenant_id", unique: true
end
+ create_table "wow_creature_families", force: :cascade do |t|
+ t.integer "creature_family_id"
+ t.jsonb "name"
+ t.integer "media_id"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["creature_family_id"], name: "index_wow_creature_families_on_creature_family_id", unique: true
+ end
+
+ create_table "wow_creature_types", force: :cascade do |t|
+ t.integer "creature_type_id"
+ t.jsonb "name"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["creature_type_id"], name: "index_wow_creature_types_on_creature_type_id", unique: true
+ end
+
+ create_table "wow_creatures", force: :cascade do |t|
+ t.integer "creature_id"
+ t.jsonb "name"
+ t.boolean "is_tameable"
+ t.integer "display_id"
+ t.bigint "wow_creature_family_id"
+ t.bigint "wow_creature_type_id"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["creature_id"], name: "index_wow_creatures_on_creature_id", unique: true
+ t.index ["wow_creature_family_id"], name: "index_wow_creatures_on_wow_creature_family_id"
+ t.index ["wow_creature_type_id"], name: "index_wow_creatures_on_wow_creature_type_id"
+ end
+
create_table "wow_geo_maps", force: :cascade do |t|
t.integer "map_id"
t.jsonb "name"
diff --git a/spec/helpers/rp_world_helper_spec.rb b/spec/helpers/rp_world_helper_spec.rb
new file mode 100644
index 0000000..a1e5e3b
--- /dev/null
+++ b/spec/helpers/rp_world_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+# Specs in this file have access to a helper object that includes
+# the RpWorldHelper. For example:
+#
+# describe RpWorldHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+RSpec.describe RpWorldHelper, type: :helper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/rp_world_spec.rb b/spec/models/rp_world_spec.rb
new file mode 100644
index 0000000..8d097fb
--- /dev/null
+++ b/spec/models/rp_world_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe RpWorld, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/wow_character_play_rp_world_spec.rb b/spec/models/wow_character_play_rp_world_spec.rb
new file mode 100644
index 0000000..4977878
--- /dev/null
+++ b/spec/models/wow_character_play_rp_world_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe WowCharacterPlayRpWorld, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/wow_creature_family_spec.rb b/spec/models/wow_creature_family_spec.rb
new file mode 100644
index 0000000..1f582a3
--- /dev/null
+++ b/spec/models/wow_creature_family_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe WowCreatureFamily, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/wow_creature_spec.rb b/spec/models/wow_creature_spec.rb
new file mode 100644
index 0000000..a38f57e
--- /dev/null
+++ b/spec/models/wow_creature_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe WowCreature, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/models/wow_creature_type_spec.rb b/spec/models/wow_creature_type_spec.rb
new file mode 100644
index 0000000..f2afb7f
--- /dev/null
+++ b/spec/models/wow_creature_type_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe WowCreatureType, type: :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/requests/rp_world_spec.rb b/spec/requests/rp_world_spec.rb
new file mode 100644
index 0000000..6f84bc2
--- /dev/null
+++ b/spec/requests/rp_world_spec.rb
@@ -0,0 +1,7 @@
+require 'rails_helper'
+
+RSpec.describe "RpWorlds", type: :request do
+ describe "GET /index" do
+ pending "add some examples (or delete) #{__FILE__}"
+ end
+end