diff --git a/.gitignore b/.gitignore index 0c4b3e8..8e6e71a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ # mine .env +erd.pdf diff --git a/Gemfile b/Gemfile index 5a36138..90477bb 100644 --- a/Gemfile +++ b/Gemfile @@ -26,5 +26,6 @@ group :development do gem 'quiet_assets' gem 'web-console', '~> 2.0' gem 'spring' + gem 'rails-erd' end diff --git a/Gemfile.lock b/Gemfile.lock index ba8e2f4..fc46d12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,6 +58,7 @@ GEM sass (>= 3.3.0) builder (3.2.2) byebug (6.0.2) + choice (0.2.0) coderay (1.1.0) coffee-rails (4.1.0) coffee-script (>= 2.2.0) @@ -134,6 +135,11 @@ GEM activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) + rails-erd (1.4.3) + activerecord (>= 3.2) + activesupport (>= 3.2) + choice (~> 0.2.0) + ruby-graphviz (~> 1.2) rails-html-sanitizer (1.0.2) loofah (~> 2.0) railties (4.2.4) @@ -143,6 +149,7 @@ GEM thor (>= 0.18.1, < 2.0) rake (10.4.2) rdoc (4.2.0) + ruby-graphviz (1.2.2) sass (3.4.18) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -202,6 +209,7 @@ DEPENDENCIES omniauth-reddit! quiet_assets rails (= 4.2.4) + rails-erd sass-rails (~> 5.0) sdoc (~> 0.4.0) simple_form diff --git a/app/assets/javascripts/awaken_types.coffee b/app/assets/javascripts/awaken_types.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/awaken_types.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/cards.coffee b/app/assets/javascripts/cards.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/cards.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/characters.coffee b/app/assets/javascripts/characters.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/characters.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/layout.coffee b/app/assets/javascripts/layout.coffee index c23f125..e69de29 100644 --- a/app/assets/javascripts/layout.coffee +++ b/app/assets/javascripts/layout.coffee @@ -1,2 +0,0 @@ -$ -> - $(".button-collapse").sideNav() diff --git a/app/assets/javascripts/leader_skills.coffee b/app/assets/javascripts/leader_skills.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/leader_skills.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/passive_skills.coffee b/app/assets/javascripts/passive_skills.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/passive_skills.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/rarities.coffee b/app/assets/javascripts/rarities.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/rarities.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/super_attacks.coffee b/app/assets/javascripts/super_attacks.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/super_attacks.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/types.coffee b/app/assets/javascripts/types.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/types.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/awaken_types.scss b/app/assets/stylesheets/awaken_types.scss new file mode 100644 index 0000000..fc1de24 --- /dev/null +++ b/app/assets/stylesheets/awaken_types.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the AwakenTypes controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/cards.scss b/app/assets/stylesheets/cards.scss new file mode 100644 index 0000000..572d046 --- /dev/null +++ b/app/assets/stylesheets/cards.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Cards controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/characters.scss b/app/assets/stylesheets/characters.scss new file mode 100644 index 0000000..0ab467a --- /dev/null +++ b/app/assets/stylesheets/characters.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Character controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/leader_skills.scss b/app/assets/stylesheets/leader_skills.scss new file mode 100644 index 0000000..b75531a --- /dev/null +++ b/app/assets/stylesheets/leader_skills.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the LeaderSkills controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/passive_skills.scss b/app/assets/stylesheets/passive_skills.scss new file mode 100644 index 0000000..597b3d2 --- /dev/null +++ b/app/assets/stylesheets/passive_skills.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the PassiveSkills controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/rarities.scss b/app/assets/stylesheets/rarities.scss new file mode 100644 index 0000000..e69cd87 --- /dev/null +++ b/app/assets/stylesheets/rarities.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Rarities controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/super_attacks.scss b/app/assets/stylesheets/super_attacks.scss new file mode 100644 index 0000000..16ab8a8 --- /dev/null +++ b/app/assets/stylesheets/super_attacks.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the SuperAttacks controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/types.scss b/app/assets/stylesheets/types.scss new file mode 100644 index 0000000..2140374 --- /dev/null +++ b/app/assets/stylesheets/types.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Types controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/awaken_types_controller.rb b/app/controllers/awaken_types_controller.rb new file mode 100644 index 0000000..41f820a --- /dev/null +++ b/app/controllers/awaken_types_controller.rb @@ -0,0 +1,51 @@ +class AwakenTypesController < ApplicationController + before_action :set_awaken_type, only: [:show, :edit, :update, :destroy] + + def index + @awaken_types = AwakenType.all + end + + def show + end + + def new + @awaken_type = AwakenType.new + end + + def create + @awaken_type = AwakenType.new(awaken_type_params) + + if @awaken_type.save + redirect_to awaken_types_path, notice: 'Awaken Type was created' + else + render :new + end + end + + def edit + end + + def update + if @awaken_type.update(awaken_type_params) + redirect_to awaken_types_path, notice: 'Awaken Type was updated' + else + render :edit + end + end + + def destroy + @awaken_type.destroy + + redirect_to awaken_types_path, notice: 'Awaken Type was deleted' + end + + private + + def awaken_type_params + params.require(:awaken_type).permit(:name) + end + + def set_awaken_type + @awaken_type = AwakenType.find(params[:id]) + end +end diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb new file mode 100644 index 0000000..6bd6325 --- /dev/null +++ b/app/controllers/cards_controller.rb @@ -0,0 +1,54 @@ +class CardsController < ApplicationController + before_action :set_card, only: [:show, :edit, :update, :destroy] + + def index + @cards = Card.all + end + + def show + end + + def new + @card = Card.new + end + + def create + @card = Card.new(card_params) + + if @card.save + redirect_to cards_path, notice: 'Card was created' + else + render :new + end + end + + def edit + end + + def update + if @card.update(card_params) + redirect_to cards_path, notice: 'Card was updated' + else + render :edit + end + end + + def destroy + @card.destroy + + redirect_to cards_path, notice: 'Card was deleted' + end + + private + + def card_params + params.require(:card).permit(:prefix, :character_id, :rarity_id, :type_id, + :leader_skill_id, :passive_skill_id, + :super_attack_id, :dokkan_id, :gameid, + :awaken_type_id, link_ids: []) + end + + def set_card + @card = Card.find(params[:id]) + end +end diff --git a/app/controllers/characters_controller.rb b/app/controllers/characters_controller.rb new file mode 100644 index 0000000..84e4e88 --- /dev/null +++ b/app/controllers/characters_controller.rb @@ -0,0 +1,51 @@ +class CharactersController < ApplicationController + before_action :set_character, only: [:show, :edit, :update, :destroy] + + def index + @characters = Character.all + end + + def show + end + + def new + @character = Character.new + end + + def create + @character = Character.new(character_params) + + if @character.save + redirect_to characters_path, notice: 'Character was created' + else + render :new + end + end + + def edit + end + + def update + if @character.update(character_params) + redirect_to characters_path, notice: 'Character was updated' + else + render :edit + end + end + + def destroy + @character.destroy + + redirect_to characters_path, notice: 'Character was deleted' + end + + private + + def character_params + params.require(:character).permit(:name) + end + + def set_character + @character = Character.find(params[:id]) + end +end diff --git a/app/controllers/leader_skills_controller.rb b/app/controllers/leader_skills_controller.rb new file mode 100644 index 0000000..545bbe5 --- /dev/null +++ b/app/controllers/leader_skills_controller.rb @@ -0,0 +1,51 @@ +class LeaderSkillsController < ApplicationController + before_action :set_leader_skill, only: [:show, :edit, :update, :destroy] + + def index + @leader_skills = LeaderSkill.all + end + + def show + end + + def new + @leader_skill = LeaderSkill.new + end + + def create + @leader_skill = LeaderSkill.new(leader_skill_params) + + if @leader_skill.save + redirect_to leader_skills_path, notice: 'Leader Skill was created' + else + render :new + end + end + + def edit + end + + def update + if @leader_skill.update(leader_skill_params) + redirect_to leader_skills_path, notice: 'Leader Skill was updated' + else + render :edit + end + end + + def destroy + @leader_skill.destroy + + redirect_to leader_skills_path, notice: 'Leader Skills was deleted' + end + + private + + def leader_skill_params + params.require(:leader_skill).permit(:name, :description) + end + + def set_leader_skill + @leader_skill = LeaderSkill.find(params[:id]) + end +end diff --git a/app/controllers/passive_skills_controller.rb b/app/controllers/passive_skills_controller.rb new file mode 100644 index 0000000..e1e87eb --- /dev/null +++ b/app/controllers/passive_skills_controller.rb @@ -0,0 +1,51 @@ +class PassiveSkillsController < ApplicationController + before_action :set_passive_skill, only: [:show, :edit, :update, :destroy] + + def index + @passive_skills = PassiveSkill.all + end + + def show + end + + def new + @passive_skill = PassiveSkill.new + end + + def create + @passive_skill = PassiveSkill.new(passive_skill_params) + + if @passive_skill.save + redirect_to passive_skills_path, notice: 'Passive Skill was created' + else + render :new + end + end + + def edit + end + + def update + if @passive_skill.update(passive_skill_params) + redirect_to passive_skills_path, notice: 'Passive Skill was updated' + else + render :edit + end + end + + def destroy + @passive_skill.destroy + + redirect_to passive_skills_path, notice: 'Passive Skill was deleted' + end + + private + + def passive_skill_params + params.require(:passive_skill).permit(:name, :description) + end + + def set_passive_skill + @passive_skill = PassiveSkill.find(params[:id]) + end +end diff --git a/app/controllers/rarities_controller.rb b/app/controllers/rarities_controller.rb new file mode 100644 index 0000000..3feaaa9 --- /dev/null +++ b/app/controllers/rarities_controller.rb @@ -0,0 +1,51 @@ +class RaritiesController < ApplicationController + before_action :set_rarity, only: [:show, :edit, :update, :destroy] + + def index + @rarities = Rarity.all + end + + def show + end + + def new + @rarity = Rarity.new + end + + def create + @rarity = Rarity.new(rarity_params) + + if @rarity.save + redirect_to rarities_path, notice: 'Rarity was created' + else + render :new + end + end + + def edit + end + + def update + if @rarity.update(rarity_params) + redirect_to rarities_path, notice: 'Rarity was updated' + else + render :edit + end + end + + def destroy + @rarity.destroy + + redirect_to rarities_path, notice: 'Rarity was deleted' + end + + private + + def rarity_params + params.require(:rarity).permit(:name, :description) + end + + def set_rarity + @rarity = Rarity.find(params[:id]) + end +end diff --git a/app/controllers/super_attacks_controller.rb b/app/controllers/super_attacks_controller.rb new file mode 100644 index 0000000..40bf28e --- /dev/null +++ b/app/controllers/super_attacks_controller.rb @@ -0,0 +1,51 @@ +class SuperAttacksController < ApplicationController + before_action :set_super_attack, only: [:show, :edit, :update, :destroy] + + def index + @super_attacks = SuperAttack.all + end + + def show + end + + def new + @super_attack = SuperAttack.new + end + + def create + @super_attack = SuperAttack.new(super_attack_params) + + if @super_attack.save + redirect_to super_attacks_path, notice: 'Super Attack was created' + else + render :new + end + end + + def edit + end + + def update + if @super_attack.update(super_attack_params) + redirect_to super_attacks_path, notice: 'Super Attack was updated' + else + render :edit + end + end + + def destroy + @super_attack.destroy + + redirect_to super_attacks_path, notice: 'Super Attack was deleted' + end + + private + + def super_attack_params + params.require(:super_attack).permit(:name, :description) + end + + def set_super_attack + @super_attack = SuperAttack.find(params[:id]) + end +end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb new file mode 100644 index 0000000..3ae9923 --- /dev/null +++ b/app/controllers/types_controller.rb @@ -0,0 +1,51 @@ +class TypesController < ApplicationController + before_action :set_type, only: [:show, :edit, :update, :destroy] + + def index + @types = Type.all + end + + def show + end + + def new + @type = Type.new + end + + def create + @type = Type.new(type_params) + + if @type.save + redirect_to types_path, notice: 'Type was created' + else + render :new + end + end + + def edit + end + + def update + if @type.update(type_params) + redirect_to types_path, notice: 'Type was updated' + else + render :edit + end + end + + def destroy + @type.destroy + + redirect_to types_path, notice: 'Type was deleted' + end + + private + + def type_params + params.require(:type).permit(:name, :description) + end + + def set_type + @type = Type.find(params[:id]) + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 20e9477..b056fff 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -16,6 +16,10 @@ module ApplicationHelper content_tag(:i, class: "glyphicon glyphicon-#{icon} " + classes) {} end + def login_path(provider) + "/auth/#{provider.to_s}" + end + private def bootstrap_classes diff --git a/app/helpers/awaken_types_helper.rb b/app/helpers/awaken_types_helper.rb new file mode 100644 index 0000000..8f31adb --- /dev/null +++ b/app/helpers/awaken_types_helper.rb @@ -0,0 +1,2 @@ +module AwakenTypesHelper +end diff --git a/app/helpers/cards_helper.rb b/app/helpers/cards_helper.rb new file mode 100644 index 0000000..82dc1f4 --- /dev/null +++ b/app/helpers/cards_helper.rb @@ -0,0 +1,2 @@ +module CardsHelper +end diff --git a/app/helpers/characters_helper.rb b/app/helpers/characters_helper.rb new file mode 100644 index 0000000..8acbd18 --- /dev/null +++ b/app/helpers/characters_helper.rb @@ -0,0 +1,2 @@ +module CharactersHelper +end diff --git a/app/helpers/leader_skills_helper.rb b/app/helpers/leader_skills_helper.rb new file mode 100644 index 0000000..a5c945f --- /dev/null +++ b/app/helpers/leader_skills_helper.rb @@ -0,0 +1,2 @@ +module LeaderSkillsHelper +end diff --git a/app/helpers/passive_skills_helper.rb b/app/helpers/passive_skills_helper.rb new file mode 100644 index 0000000..a3593cc --- /dev/null +++ b/app/helpers/passive_skills_helper.rb @@ -0,0 +1,2 @@ +module PassiveSkillsHelper +end diff --git a/app/helpers/rarities_helper.rb b/app/helpers/rarities_helper.rb new file mode 100644 index 0000000..b94acb1 --- /dev/null +++ b/app/helpers/rarities_helper.rb @@ -0,0 +1,2 @@ +module RaritiesHelper +end diff --git a/app/helpers/super_attacks_helper.rb b/app/helpers/super_attacks_helper.rb new file mode 100644 index 0000000..79db227 --- /dev/null +++ b/app/helpers/super_attacks_helper.rb @@ -0,0 +1,2 @@ +module SuperAttacksHelper +end diff --git a/app/helpers/types_helper.rb b/app/helpers/types_helper.rb new file mode 100644 index 0000000..40a2b9e --- /dev/null +++ b/app/helpers/types_helper.rb @@ -0,0 +1,2 @@ +module TypesHelper +end diff --git a/app/models/awaken_type.rb b/app/models/awaken_type.rb new file mode 100644 index 0000000..7862d09 --- /dev/null +++ b/app/models/awaken_type.rb @@ -0,0 +1,3 @@ +class AwakenType < ActiveRecord::Base + validates :name, presence: true +end diff --git a/app/models/card.rb b/app/models/card.rb new file mode 100644 index 0000000..71a40fe --- /dev/null +++ b/app/models/card.rb @@ -0,0 +1,27 @@ +class Card < ActiveRecord::Base + belongs_to :character + belongs_to :rarity + belongs_to :type + belongs_to :leader_skill + belongs_to :passive_skill + belongs_to :super_attack + belongs_to :awaken_type + has_one :dokkan_card, class_name: 'Card', foreign_key: :dokkan_id + + has_and_belongs_to_many :links + + delegate :name, to: :character, prefix: false + + validates :prefix, presence: true + validates :character, presence: true + validates :gameid, presence: true, + numericality: { only_integer: true }, + length: { is: 7 } + validates :rarity, presence: true + validates :type, presence: true + validates :awaken_type, presence: true + + def dokkan? + self.dokkan_id != nil + end +end diff --git a/app/models/cards_link.rb b/app/models/cards_link.rb new file mode 100644 index 0000000..21b719e --- /dev/null +++ b/app/models/cards_link.rb @@ -0,0 +1,4 @@ +class CardsLink < ActiveRecord::Base + belongs_to :card + belongs_to :link +end diff --git a/app/models/character.rb b/app/models/character.rb new file mode 100644 index 0000000..b195202 --- /dev/null +++ b/app/models/character.rb @@ -0,0 +1,4 @@ +class Character < ActiveRecord::Base + validates :name, presence: true, + uniqueness: { case_sensitive: false } +end diff --git a/app/models/leader_skill.rb b/app/models/leader_skill.rb new file mode 100644 index 0000000..ed9757a --- /dev/null +++ b/app/models/leader_skill.rb @@ -0,0 +1,4 @@ +class LeaderSkill < ActiveRecord::Base + validates :name, presence: true + validates :description, presence: true +end diff --git a/app/models/link.rb b/app/models/link.rb index 03002b0..0407fa0 100644 --- a/app/models/link.rb +++ b/app/models/link.rb @@ -1,4 +1,6 @@ class Link < ActiveRecord::Base + has_and_belongs_to_many :cards + validates :name, presence: true, uniqueness: true end diff --git a/app/models/medal.rb b/app/models/medal.rb new file mode 100644 index 0000000..8012605 --- /dev/null +++ b/app/models/medal.rb @@ -0,0 +1,2 @@ +class Medal < ActiveRecord::Base +end diff --git a/app/models/passive_skill.rb b/app/models/passive_skill.rb new file mode 100644 index 0000000..902dcc3 --- /dev/null +++ b/app/models/passive_skill.rb @@ -0,0 +1,4 @@ +class PassiveSkill < ActiveRecord::Base + validates :name, presence: true + validates :description, presence: true +end diff --git a/app/models/rarity.rb b/app/models/rarity.rb new file mode 100644 index 0000000..39e9d46 --- /dev/null +++ b/app/models/rarity.rb @@ -0,0 +1,5 @@ +class Rarity < ActiveRecord::Base + validates :name, presence: true, + uniqueness: { case_sensitive: false } + validates :description, presence: true +end diff --git a/app/models/super_attack.rb b/app/models/super_attack.rb new file mode 100644 index 0000000..7e2db48 --- /dev/null +++ b/app/models/super_attack.rb @@ -0,0 +1,4 @@ +class SuperAttack < ActiveRecord::Base + validates :name, presence: true + validates :description, presence: true +end diff --git a/app/models/type.rb b/app/models/type.rb new file mode 100644 index 0000000..bfc271d --- /dev/null +++ b/app/models/type.rb @@ -0,0 +1,5 @@ +class Type < ActiveRecord::Base + validates :name, presence: true, + uniqueness: { case_sensitive: false } + validates :description, presence: true +end diff --git a/app/views/application/_navbar.html.slim b/app/views/application/_navbar.html.slim index c219251..ede54ff 100644 --- a/app/views/application/_navbar.html.slim +++ b/app/views/application/_navbar.html.slim @@ -9,8 +9,26 @@ = link_to 'DBZDokkan', root_path, class: 'navbar-brand' .collapse.navbar-collapse ul.nav.navbar-nav.navbar-right - li= nav_link_to 'Links', links_path + li.dropdown + a href='#' class='dropdown-toggle' data-toggle='dropdown' + = 'Abilities ' + span class='caret' + ul.dropdown-menu + li= link_to 'Links', links_path + li= link_to 'Leader Skills', leader_skills_path + li= link_to 'Passive Skills', passive_skills_path + li= link_to 'Super Attacks', super_attacks_path + li= nav_link_to 'Cards', cards_path + li= nav_link_to 'Characters', characters_path + li.dropdown + a href='#' class='dropdown-toggle' data-toggle='dropdown' + = 'Others ' + span class='caret' + ul.dropdown-menu + li= link_to 'Awaken Types', awaken_types_path + li= link_to 'Rarities', rarities_path + li= link_to 'Types', types_path - if logged_in? li= link_to 'Log Out', logout_path, method: :delete - else - li= link_to 'Log In', '/auth/reddit' + li= link_to 'Log In', login_path(:reddit) diff --git a/app/views/awaken_types/_form.html.slim b/app/views/awaken_types/_form.html.slim new file mode 100644 index 0000000..f9451c1 --- /dev/null +++ b/app/views/awaken_types/_form.html.slim @@ -0,0 +1,5 @@ += simple_form_for @awaken_type do |f| + .form-inputs + = f.input :name + .form-actions + = f.button :button diff --git a/app/views/awaken_types/edit.html.slim b/app/views/awaken_types/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/awaken_types/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/awaken_types/index.html.slim b/app/views/awaken_types/index.html.slim new file mode 100644 index 0000000..9dcc82f --- /dev/null +++ b/app/views/awaken_types/index.html.slim @@ -0,0 +1,23 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Awaken Type', new_awaken_type_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Actions + tbody + - @awaken_types.each do |awaken_type| + tr + td= awaken_type.name + td + = link_to glyph('edit', classes: 'control-icon'), edit_awaken_type_path(awaken_type) + = link_to glyph('trash', classes: 'control-icon'), awaken_type_path(awaken_type), method: :delete + +.row + .col-md-12 + = link_to 'New Awaken Type', new_awaken_type_path, class: 'btn btn-primary' diff --git a/app/views/awaken_types/new.html.slim b/app/views/awaken_types/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/awaken_types/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/cards/_form.html.slim b/app/views/cards/_form.html.slim new file mode 100644 index 0000000..0c3ec0f --- /dev/null +++ b/app/views/cards/_form.html.slim @@ -0,0 +1,31 @@ += simple_form_for @card do |f| + .form-inputs + .row + .col-md-4 + = f.input :gameid, label: 'Game ID Number' + .col-md-4 + = f.input :prefix + .col-md-4 + = f.association :character + .row + .col-md-4 + = f.association :rarity + .col-md-4 + = f.association :type + .col-md-4 + = f.association :awaken_type + .row + .col-md-6 + = f.association :leader_skill + .col-md-6 + = f.association :passive_skill + .row + .col-md-6 + = f.association :super_attack + .row + .col-md-12 + = f.label :links + div + = f.association :links, as: :check_boxes, item_wrapper_tag: nil, item_label_class: 'checkbox-inline', label: false + .form-actions + = f.button :button diff --git a/app/views/cards/edit.html.slim b/app/views/cards/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/cards/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/cards/index.html.slim b/app/views/cards/index.html.slim new file mode 100644 index 0000000..7953510 --- /dev/null +++ b/app/views/cards/index.html.slim @@ -0,0 +1,25 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Card', new_card_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Prefix + th Name + th Actions + tbody + - @cards.each do |card| + tr + td= card.prefix + td= card.name + td + = link_to glyph('edit', classes: 'control-icon'), edit_card_path(card) + = link_to glyph('trash', classes: 'control-icon'), card_path(card), method: :delete + +.row + .col-md-12 + = link_to 'New Card', new_card_path, class: 'btn btn-primary' diff --git a/app/views/cards/new.html.slim b/app/views/cards/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/cards/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/characters/_form.html.slim b/app/views/characters/_form.html.slim new file mode 100644 index 0000000..36b96cf --- /dev/null +++ b/app/views/characters/_form.html.slim @@ -0,0 +1,5 @@ += simple_form_for @character do |f| + .form-inputs + = f.input :name + .form-actions + = f.button :button diff --git a/app/views/characters/edit.html.slim b/app/views/characters/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/characters/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/characters/index.html.slim b/app/views/characters/index.html.slim new file mode 100644 index 0000000..833fcfe --- /dev/null +++ b/app/views/characters/index.html.slim @@ -0,0 +1,23 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Character', new_character_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Actions + tbody + - @characters.each do |character| + tr + td= character.name + td + = link_to glyph('edit', classes: 'control-icon'), edit_character_path(character) + = link_to glyph('trash', classes: 'control-icon'), character_path(character), method: :delete + +.row + .col-md-12 + = link_to 'New Character', new_character_path, class: 'btn btn-primary' diff --git a/app/views/characters/new.html.slim b/app/views/characters/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/characters/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/leader_skills/_form.html.slim b/app/views/leader_skills/_form.html.slim new file mode 100644 index 0000000..269ec02 --- /dev/null +++ b/app/views/leader_skills/_form.html.slim @@ -0,0 +1,6 @@ += simple_form_for @leader_skill do |f| + .form-inputs + = f.input :name + = f.input :description + .form-actions + = f.button :button diff --git a/app/views/leader_skills/edit.html.slim b/app/views/leader_skills/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/leader_skills/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/leader_skills/index.html.slim b/app/views/leader_skills/index.html.slim new file mode 100644 index 0000000..3d8255a --- /dev/null +++ b/app/views/leader_skills/index.html.slim @@ -0,0 +1,25 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Leader Skill', new_leader_skill_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Description + th Actions + tbody + - @leader_skills.each do |leader_skill| + tr + td= leader_skill.name + td= leader_skill.description + td + = link_to glyph('edit', classes: 'control-icon'), edit_leader_skill_path(leader_skill) + = link_to glyph('trash', classes: 'control-icon'), leader_skill_path(leader_skill), method: :delete + +.row + .col-md-12 + = link_to 'New Leader Skill', new_leader_skill_path, class: 'btn btn-primary' diff --git a/app/views/leader_skills/new.html.slim b/app/views/leader_skills/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/leader_skills/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/passive_skills/_form.html.slim b/app/views/passive_skills/_form.html.slim new file mode 100644 index 0000000..1f52871 --- /dev/null +++ b/app/views/passive_skills/_form.html.slim @@ -0,0 +1,6 @@ += simple_form_for @passive_skill do |f| + .form-inputs + = f.input :name + = f.input :description + .form-actions + = f.button :button diff --git a/app/views/passive_skills/edit.html.slim b/app/views/passive_skills/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/passive_skills/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/passive_skills/index.html.slim b/app/views/passive_skills/index.html.slim new file mode 100644 index 0000000..51c0def --- /dev/null +++ b/app/views/passive_skills/index.html.slim @@ -0,0 +1,25 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Passive Skill', new_passive_skill_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Description + th Actions + tbody + - @passive_skills.each do |passive_skill| + tr + td= passive_skill.name + td= passive_skill.description + td + = link_to glyph('edit', classes: 'control-icon'), edit_passive_skill_path(passive_skill) + = link_to glyph('trash', classes: 'control-icon'), passive_skill_path(passive_skill), method: :delete + +.row + .col-md-12 + = link_to 'New Passive Skill', new_passive_skill_path, class: 'btn btn-primary' diff --git a/app/views/passive_skills/new.html.slim b/app/views/passive_skills/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/passive_skills/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/rarities/_form.html.slim b/app/views/rarities/_form.html.slim new file mode 100644 index 0000000..dbbac98 --- /dev/null +++ b/app/views/rarities/_form.html.slim @@ -0,0 +1,6 @@ += simple_form_for @rarity do |f| + .form-inputs + = f.input :name + = f.input :description + .form-actions + = f.button :button diff --git a/app/views/rarities/edit.html.slim b/app/views/rarities/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/rarities/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/rarities/index.html.slim b/app/views/rarities/index.html.slim new file mode 100644 index 0000000..7cfe7b4 --- /dev/null +++ b/app/views/rarities/index.html.slim @@ -0,0 +1,25 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Rarity', new_rarity_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Description + th Actions + tbody + - @rarities.each do |rarity| + tr + td= rarity.name + td= rarity.description + td + = link_to glyph('edit', classes: 'control-icon'), edit_rarity_path(rarity) + = link_to glyph('trash', classes: 'control-icon'), rarity_path(rarity), method: :delete + +.row + .col-md-12 + = link_to 'New Rarity', new_rarity_path, class: 'btn btn-primary' diff --git a/app/views/rarities/new.html.slim b/app/views/rarities/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/rarities/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/super_attacks/_form.html.slim b/app/views/super_attacks/_form.html.slim new file mode 100644 index 0000000..b62f2b2 --- /dev/null +++ b/app/views/super_attacks/_form.html.slim @@ -0,0 +1,6 @@ += simple_form_for @super_attack do |f| + .form-inputs + = f.input :name + = f.input :description + .form-actions + = f.button :button diff --git a/app/views/super_attacks/edit.html.slim b/app/views/super_attacks/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/super_attacks/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/super_attacks/index.html.slim b/app/views/super_attacks/index.html.slim new file mode 100644 index 0000000..7d44b2d --- /dev/null +++ b/app/views/super_attacks/index.html.slim @@ -0,0 +1,25 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Super Attack', new_super_attack_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Description + th Actions + tbody + - @super_attacks.each do |super_attack| + tr + td= super_attack.name + td= super_attack.description + td + = link_to glyph('edit', classes: 'control-icon'), edit_super_attack_path(super_attack) + = link_to glyph('trash', classes: 'control-icon'), super_attack_path(super_attack), method: :delete + +.row + .col-md-12 + = link_to 'New Super Attack', new_super_attack_path, class: 'btn btn-primary' diff --git a/app/views/super_attacks/new.html.slim b/app/views/super_attacks/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/super_attacks/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/types/_form.html.slim b/app/views/types/_form.html.slim new file mode 100644 index 0000000..e78f58e --- /dev/null +++ b/app/views/types/_form.html.slim @@ -0,0 +1,6 @@ += simple_form_for @type do |f| + .form-inputs + = f.input :name + = f.input :description + .form-actions + = f.button :button diff --git a/app/views/types/edit.html.slim b/app/views/types/edit.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/types/edit.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/app/views/types/index.html.slim b/app/views/types/index.html.slim new file mode 100644 index 0000000..67464b3 --- /dev/null +++ b/app/views/types/index.html.slim @@ -0,0 +1,25 @@ +.row + .col-md-12 + .pull-right + = link_to 'New Type', new_type_path, class: 'btn btn-primary' + +.row + .col-md-12 + table.table.table-striped.table-hover + thead + tr + th Name + th Description + th Actions + tbody + - @types.each do |type| + tr + td= type.name + td= type.description + td + = link_to glyph('edit', classes: 'control-icon'), edit_type_path(type) + = link_to glyph('trash', classes: 'control-icon'), type_path(type), method: :delete + +.row + .col-md-12 + = link_to 'New Type', new_type_path, class: 'btn btn-primary' diff --git a/app/views/types/new.html.slim b/app/views/types/new.html.slim new file mode 100644 index 0000000..fbedb45 --- /dev/null +++ b/app/views/types/new.html.slim @@ -0,0 +1 @@ +== render 'form' diff --git a/config/routes.rb b/config/routes.rb index 5539ee5..bc3e9bd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,15 @@ Rails.application.routes.draw do get 'auth/failure', to: 'sessions#failure' delete 'logout', to: 'sessions#destroy', as: 'logout' + resources :awaken_types + resources :cards + resources :characters + resources :leader_skills resources :links + resources :passive_skills + resources :rarities + resources :super_attacks + resources :types resources :welcome, only: [:index] root to: 'welcome#index' diff --git a/db/migrate/20151006175227_create_characters.rb b/db/migrate/20151006175227_create_characters.rb new file mode 100644 index 0000000..cf47e88 --- /dev/null +++ b/db/migrate/20151006175227_create_characters.rb @@ -0,0 +1,9 @@ +class CreateCharacters < ActiveRecord::Migration + def change + create_table :characters do |t| + t.string :name + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006175240_create_rarities.rb b/db/migrate/20151006175240_create_rarities.rb new file mode 100644 index 0000000..35d41ad --- /dev/null +++ b/db/migrate/20151006175240_create_rarities.rb @@ -0,0 +1,10 @@ +class CreateRarities < ActiveRecord::Migration + def change + create_table :rarities do |t| + t.string :name + t.string :description + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006175252_create_types.rb b/db/migrate/20151006175252_create_types.rb new file mode 100644 index 0000000..435e3a0 --- /dev/null +++ b/db/migrate/20151006175252_create_types.rb @@ -0,0 +1,10 @@ +class CreateTypes < ActiveRecord::Migration + def change + create_table :types do |t| + t.string :name + t.string :description + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006175332_create_medals.rb b/db/migrate/20151006175332_create_medals.rb new file mode 100644 index 0000000..8a760ad --- /dev/null +++ b/db/migrate/20151006175332_create_medals.rb @@ -0,0 +1,10 @@ +class CreateMedals < ActiveRecord::Migration + def change + create_table :medals do |t| + t.string :name + t.text :location + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006175353_create_leader_skills.rb b/db/migrate/20151006175353_create_leader_skills.rb new file mode 100644 index 0000000..895a82e --- /dev/null +++ b/db/migrate/20151006175353_create_leader_skills.rb @@ -0,0 +1,10 @@ +class CreateLeaderSkills < ActiveRecord::Migration + def change + create_table :leader_skills do |t| + t.string :name + t.string :description + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006175429_create_passive_skills.rb b/db/migrate/20151006175429_create_passive_skills.rb new file mode 100644 index 0000000..1d204f8 --- /dev/null +++ b/db/migrate/20151006175429_create_passive_skills.rb @@ -0,0 +1,10 @@ +class CreatePassiveSkills < ActiveRecord::Migration + def change + create_table :passive_skills do |t| + t.string :name + t.string :description + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006175442_create_super_attacks.rb b/db/migrate/20151006175442_create_super_attacks.rb new file mode 100644 index 0000000..5fe5822 --- /dev/null +++ b/db/migrate/20151006175442_create_super_attacks.rb @@ -0,0 +1,10 @@ +class CreateSuperAttacks < ActiveRecord::Migration + def change + create_table :super_attacks do |t| + t.string :name + t.string :description + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006180454_create_cards.rb b/db/migrate/20151006180454_create_cards.rb new file mode 100644 index 0000000..9c72a28 --- /dev/null +++ b/db/migrate/20151006180454_create_cards.rb @@ -0,0 +1,17 @@ +class CreateCards < ActiveRecord::Migration + def change + create_table :cards do |t| + t.references :character, index: true, foreign_key: true + t.references :rarity, index: true, foreign_key: true + t.references :type, index: true, foreign_key: true + t.references :leader_skill, index: true, foreign_key: true + t.references :passive_skill, index: true, foreign_key: true + t.references :super_attack, index: true, foreign_key: true + t.integer :dokkan_id, index: true, foreign_key: true + t.string :suffix + t.string :gameid + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151006182022_create_cards_links.rb b/db/migrate/20151006182022_create_cards_links.rb new file mode 100644 index 0000000..c5ba333 --- /dev/null +++ b/db/migrate/20151006182022_create_cards_links.rb @@ -0,0 +1,10 @@ +class CreateCardsLinks < ActiveRecord::Migration + def change + create_join_table :cards, :links do |t| + t.references :card, index: true, foreign_key: true + t.references :link, index: true, foreign_key: true + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20151007130958_fix_card_fields.rb b/db/migrate/20151007130958_fix_card_fields.rb new file mode 100644 index 0000000..5c00a32 --- /dev/null +++ b/db/migrate/20151007130958_fix_card_fields.rb @@ -0,0 +1,6 @@ +class FixCardFields < ActiveRecord::Migration + def change + change_column :cards, :gameid, :string, default: '0000000' + rename_column :cards, :suffix, :prefix + end +end diff --git a/db/migrate/20151007164606_create_awaken_types.rb b/db/migrate/20151007164606_create_awaken_types.rb new file mode 100644 index 0000000..1430108 --- /dev/null +++ b/db/migrate/20151007164606_create_awaken_types.rb @@ -0,0 +1,11 @@ +class CreateAwakenTypes < ActiveRecord::Migration + def change + create_table :awaken_types do |t| + t.string :name + + t.timestamps null: false + end + + add_reference :cards, :awaken_type, index: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 2435f4d..4c707de 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,60 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151001151519) do +ActiveRecord::Schema.define(version: 20151007164606) do + + create_table "awaken_types", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "cards", force: :cascade do |t| + t.integer "character_id" + t.integer "rarity_id" + t.integer "type_id" + t.integer "leader_skill_id" + t.integer "passive_skill_id" + t.integer "super_attack_id" + t.integer "dokkan_id" + t.string "prefix" + t.string "gameid", default: "0000000" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "awaken_type_id" + end + + add_index "cards", ["awaken_type_id"], name: "index_cards_on_awaken_type_id" + add_index "cards", ["character_id"], name: "index_cards_on_character_id" + add_index "cards", ["dokkan_id"], name: "index_cards_on_dokkan_id" + add_index "cards", ["leader_skill_id"], name: "index_cards_on_leader_skill_id" + add_index "cards", ["passive_skill_id"], name: "index_cards_on_passive_skill_id" + add_index "cards", ["rarity_id"], name: "index_cards_on_rarity_id" + add_index "cards", ["super_attack_id"], name: "index_cards_on_super_attack_id" + add_index "cards", ["type_id"], name: "index_cards_on_type_id" + + create_table "cards_links", id: false, force: :cascade do |t| + t.integer "card_id" + t.integer "link_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "cards_links", ["card_id"], name: "index_cards_links_on_card_id" + add_index "cards_links", ["link_id"], name: "index_cards_links_on_link_id" + + create_table "characters", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "leader_skills", force: :cascade do |t| + t.string "name" + t.string "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end create_table "links", force: :cascade do |t| t.string "name" @@ -20,6 +73,41 @@ ActiveRecord::Schema.define(version: 20151001151519) do t.datetime "updated_at", null: false end + create_table "medals", force: :cascade do |t| + t.string "name" + t.text "location" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "passive_skills", force: :cascade do |t| + t.string "name" + t.string "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "rarities", force: :cascade do |t| + t.string "name" + t.string "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "super_attacks", force: :cascade do |t| + t.string "name" + t.string "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "types", force: :cascade do |t| + t.string "name" + t.string "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "users", force: :cascade do |t| t.string "provider" t.string "uid" diff --git a/db/seeds.rb b/db/seeds.rb index 4edb1e8..4c3e710 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,7 +1,32 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) -# Mayor.create(name: 'Emanuel', city: cities.first) +types = [ + ['Physical', 'PHY', 'yellow'], + ['Intellect', 'INT', 'purple'], + ['Technique', 'TEQ', 'green'], + ['Agility', 'AGL', 'blue'], + ['Strength', 'STR', 'red'], +] + +rarities = [ + ['Normal', 'N'], + ['Rare', 'R'], + ['Super Rare', 'SR'], + ['Super Super Rare', 'SSR'], + ['Ultra Rare', 'UR'], +] + +awaken_types = [ + 'Super', + 'Extreme', +] + +types.each do |description, name| + Type.create(name: name, description: description) +end + +rarities.each do |description, name| + Rarity.create(name: name, description: description) +end + +awaken_types.each do |name| + AwakenType.create(name: name) +end