Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_hss
杨树明 5 years ago
commit a945aa0cd2

@ -30,7 +30,7 @@ class Users::QuestionBanksController < Users::BaseController
.where(commit_status: 1, exercises: { exercise_bank_id: question_bank_ids })
.group('exercises.exercise_bank_id').count
when 'poll' then
PollUser.joins(:poll).where(polls: { exercise_bank_id: question_bank_ids })
PollUser.joins(:poll).where(commit_status: 1, polls: { exercise_bank_id: question_bank_ids })
.group('polls.exercise_bank_id').count
when 'gtask' then
GraduationWork.has_committed.joins(:graduation_task)

@ -0,0 +1,23 @@
class MigrateBankQuotes < ActiveRecord::Migration[5.2]
def change
HomeworkBank.all.each do |bank|
bank.update_column("quotes", bank.homework_commons.count)
end
GtopicBank.all.each do |bank|
bank.update_column("quotes", bank.graduation_topics.count)
end
GtaskBank.all.each do |bank|
bank.update_column("quotes", bank.graduation_tasks.count)
end
ExerciseBank.all.each do |bank|
if bank.container_type == 'Exercise'
bank.update_column("quotes", bank.exercises.count)
elsif bank.container_type == 'Poll'
bank.update_column("quotes", bank.polls.count)
end
end
end
end

@ -173,7 +173,7 @@ class Bullsubdirectory extends Component{
}
var url = `/courses/${id}/update_informs.json`;
axios.post(url,{
inform_id:this.state.id,
inform_id:this.props.id,
name:titname,
description:values.description,
}).then((result) => {

Loading…
Cancel
Save