From 2fe8b3c93da3f714211fef480fcd5f8008aaf0dc Mon Sep 17 00:00:00 2001 From: Godwin Date: Fri, 16 Sep 2016 12:36:17 -0700 Subject: [PATCH] Fixed saving housing availability --- app/controllers/conferences_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index a65c806..b3d004c 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -847,7 +847,15 @@ class ConferencesController < ApplicationController user_changed = true when :is_attending registration.is_attending = value.present? ? 'y' : 'n' - when :address, :phone, :first_day, :last_day, :notes + when :first_day + registration.housing_data ||= {} + registration.housing_data['availability'] ||= [] + registration.housing_data['availability'][0] = value + when :last_day + registration.housing_data ||= {} + registration.housing_data['availability'] ||= [] + registration.housing_data['availability'][1] = value + when :address, :phone, :notes registration.housing_data ||= {} registration.housing_data[key.to_s] = value else