From 7933423700b924b7f9483cbd086bfaea2e010e56 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 31 Aug 2019 10:11:22 +0800 Subject: [PATCH] tiaoz --- app/controllers/poll_bank_questions_controller.rb | 2 +- app/models/exercise_bank_question.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/poll_bank_questions_controller.rb b/app/controllers/poll_bank_questions_controller.rb index 19111f4ca..71f302115 100644 --- a/app/controllers/poll_bank_questions_controller.rb +++ b/app/controllers/poll_bank_questions_controller.rb @@ -127,7 +127,7 @@ class PollBankQuestionsController < ApplicationController end def poll_questions_params - params.require(:poll_question).permit(:question_title,:question_type,:is_necessary,:question_number,:max_choices,:min_choices) + params.permit(:question_title,:question_type,:is_necessary,:question_number,:max_choices,:min_choices) end def validates_params diff --git a/app/models/exercise_bank_question.rb b/app/models/exercise_bank_question.rb index 14b166333..fdd343f5a 100644 --- a/app/models/exercise_bank_question.rb +++ b/app/models/exercise_bank_question.rb @@ -1,6 +1,6 @@ class ExerciseBankQuestion < ApplicationRecord belongs_to :exercise_bank - belongs_to :shixun + belongs_to :shixun, optional: true has_many :exercise_bank_shixun_challenges,:dependent => :destroy has_many :exercise_bank_choices, :dependent => :destroy has_many :exercise_bank_standard_answers, :dependent => :destroy