From 4bc96847f621c4cb3940fe99b3b4b67b20596189 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 3 Oct 2017 16:18:46 -0400 Subject: Removed box model It seemed kind of strange to have a model that there should always be exactly 14 of for each of the parent (Trainer) model instances, so the box names were moved into the Trainer model, and the Box model was removed. This commit also adds some eager loading to speed up page loading times. Also made a small change to the way the gift ribbons are extracted. refs #2 --- test/dummy/db/schema.rb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'test/dummy/db') diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 87db1f8..b1c02e3 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -10,17 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171003154157) do - - create_table "pokeviewer_boxes", force: :cascade do |t| - t.integer "trainer_id", null: false - t.integer "number", null: false - t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["trainer_id", "number"], name: "index_pokeviewer_boxes_on_trainer_id_and_number", unique: true - t.index ["trainer_id"], name: "index_pokeviewer_boxes_on_trainer_id" - end +ActiveRecord::Schema.define(version: 20171003191205) do create_table "pokeviewer_gift_ribbons", force: :cascade do |t| t.string "description", null: false @@ -158,6 +148,20 @@ ActiveRecord::Schema.define(version: 20171003154157) do t.integer "national_ribbon_id" t.integer "earth_ribbon_id" t.integer "world_ribbon_id" + t.string "box_1_name", null: false + t.string "box_2_name", null: false + t.string "box_3_name", null: false + t.string "box_4_name", null: false + t.string "box_5_name", null: false + t.string "box_6_name", null: false + t.string "box_7_name", null: false + t.string "box_8_name", null: false + t.string "box_9_name", null: false + t.string "box_10_name", null: false + t.string "box_11_name", null: false + t.string "box_12_name", null: false + t.string "box_13_name", null: false + t.string "box_14_name", null: false t.index ["country_ribbon_id"], name: "index_pokeviewer_trainers_on_country_ribbon_id" t.index ["earth_ribbon_id"], name: "index_pokeviewer_trainers_on_earth_ribbon_id" t.index ["land_ribbon_id"], name: "index_pokeviewer_trainers_on_land_ribbon_id" -- cgit 1.4.1