app/controllers/manage/dashboard_controller.rb in hackathon_manager-0.11.2 vs app/controllers/manage/dashboard_controller.rb in hackathon_manager-0.12.0
- old
+ new
@@ -44,10 +44,10 @@
render json: results
end
def schools_confirmed_data
schools = Questionnaire.joins(:school).group('schools.name').where("acc_status = 'rsvp_confirmed'").order("schools.name ASC").count
- schools_riding = Questionnaire.joins(:school).group('schools.name').where("acc_status = 'rsvp_confirmed' AND riding_bus AND schools.bus_list_id").count
+ schools_riding = Questionnaire.joins(:school).group('schools.name').where("acc_status = 'rsvp_confirmed' AND bus_list_id").count
schools = schools.map do |name, count|
bus_count_row = schools_riding.select { |school_bus_name, _| school_bus_name == name }
bus_count = bus_count_row ? bus_count_row[name] || 0 : 0
count_without_bus = count - bus_count
[name, count_without_bus, bus_count]