1
0
Fork 0

Allow verification checkbox for cards

This commit is contained in:
Andrew Tomaka 2015-10-14 11:20:02 -04:00
parent caf7178189
commit 4e78901739
4 changed files with 13 additions and 25 deletions

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,5 @@
class AddVerifiedToCards < ActiveRecord::Migration
def change
add_column :cards, :verified, :bool, default: false
end
end

View File

@ -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"