diff --git a/app/controllers/admin/cards_controller.rb b/app/controllers/admin/cards_controller.rb index 882a488..7659e15 100644 --- a/app/controllers/admin/cards_controller.rb +++ b/app/controllers/admin/cards_controller.rb @@ -61,7 +61,7 @@ class Admin::CardsController < Admin::BaseController def card_params params.require(:card).permit(:title, :character_id, :rarity_id, :type_id, - :leader_skill_id, :passive_skill_id, + :leader_skill_id, :passive_skill_id, :verified, :super_attack_id, :dokkan_id, :gameid, :awaken_type_id, :dokkan_id, link_ids: []) end diff --git a/app/views/admin/cards/_form.html.slim b/app/views/admin/cards/_form.html.slim index 6ffc0a4..a996cd0 100644 --- a/app/views/admin/cards/_form.html.slim +++ b/app/views/admin/cards/_form.html.slim @@ -30,5 +30,9 @@ = f.label :links div = f.association :links, as: :check_boxes, item_wrapper_tag: nil, item_label_class: 'checkbox-inline', label: false + .row + .col-md-12 + = f.label 'Verification' + = f.input :verified, as: :boolean, item_wrapper_tag: nil, item_label_class: 'checkbox-inline' .form-actions = f.button :button diff --git a/db/migrate/20151014143908_add_verified_to_cards.rb b/db/migrate/20151014143908_add_verified_to_cards.rb new file mode 100644 index 0000000..9c762c6 --- /dev/null +++ b/db/migrate/20151014143908_add_verified_to_cards.rb @@ -0,0 +1,5 @@ +class AddVerifiedToCards < ActiveRecord::Migration + def change + add_column :cards, :verified, :bool, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 33c88fa..5ebdf84 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151014121824) do +ActiveRecord::Schema.define(version: 20151014143908) do create_table "awaken_types", force: :cascade do |t| t.string "name" @@ -19,29 +19,8 @@ ActiveRecord::Schema.define(version: 20151014121824) do 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 "title" - 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" +# Could not dump table "cards" because of following NoMethodError +# undefined method `[]' for nil:NilClass create_table "cards_links", id: false, force: :cascade do |t| t.integer "card_id"