From b4ff73022928ef9d5b4a17df375c4dd4f174fe55 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 21 Jul 2017 14:21:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=AD=94=E9=A2=98=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/challenge_question.rb | 3 +++ .../20170721060845_create_challenge_questions.rb | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 app/models/challenge_question.rb create mode 100644 db/migrate/20170721060845_create_challenge_questions.rb diff --git a/app/models/challenge_question.rb b/app/models/challenge_question.rb new file mode 100644 index 000000000..bda6780ce --- /dev/null +++ b/app/models/challenge_question.rb @@ -0,0 +1,3 @@ +class ChallengeQuestion < ActiveRecord::Base + attr_accessible :challenge_id, :option, :position, :right_key +end diff --git a/db/migrate/20170721060845_create_challenge_questions.rb b/db/migrate/20170721060845_create_challenge_questions.rb new file mode 100644 index 000000000..5965d8cec --- /dev/null +++ b/db/migrate/20170721060845_create_challenge_questions.rb @@ -0,0 +1,12 @@ +class CreateChallengeQuestions < ActiveRecord::Migration + def change + create_table :challenge_questions do |t| + t.text :option_name + t.integer :challenge_id + t.boolean :right_key + t.integer :position, :limit => 1 + + t.timestamps + end + end +end