From ab2e8201dcdfb2c9619469c8f158fe0b3159a888 Mon Sep 17 00:00:00 2001 From: Godwin Date: Fri, 23 Sep 2016 13:21:02 -0700 Subject: [PATCH] Fixed an error on the home page that occurs when the schedule is published --- app/controllers/application_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fe74085..1d4f20d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -570,10 +570,10 @@ class ApplicationController < LinguaFrancaApplicationController @schedule.each do | day, data | @schedule[day][:times] = data[:times].sort.to_h - if do_analyze || @schedule[day][:locations].empty? - @schedule[day][:locations] ||= {} - @schedule[day][:locations][0] = :add - end + @schedule[day][:locations] ||= {} + + # add an empty block if no workshops are scheduled on this day yet + @schedule[day][:locations][0] = :add if do_analyze || @schedule[day][:locations].empty? if do_analyze data[:times].each do | time, time_data |