fixing bugs with school_question creation

pull/1/head
Jared Cosulich 7 years ago
parent c7892bcb86
commit 5dc79e5da7

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20181218154720) do
ActiveRecord::Schema.define(version: 20181221180917) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -168,6 +168,7 @@ ActiveRecord::Schema.define(version: 20181218154720) do
t.string "year"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "response_total"
end
create_table "schools", force: :cascade do |t|

@ -461,6 +461,7 @@ namespace :data do
next if school.district.name != "Boston"
attempt_data = Attempt.
joins(:question).
created_in(school_category.year).
for_question(question).
for_school(school).
@ -469,7 +470,7 @@ namespace :data do
available_responders = school.available_responders_for(question)
school_question = school_category.school_questions.for(school, question)
school_question = school_category.school_questions.for(school, question).first
if school_question.present?
school_questions << school_question
else

Loading…
Cancel
Save