Introduce an Admin::EventScheduleController

- move SchedulesController#update action
- split it into an #create/#update and #destroy action and use these actions in the JS code
This commit is contained in:
Ana 2016-08-01 00:52:52 +02:00
parent a394293500
commit 5001848af7
10 changed files with 108 additions and 81 deletions

View file

@ -10,13 +10,15 @@ FactoryGirl.define do
end
(event_schedule.room = create(:room, venue: venue)) unless event_schedule.room.present?
(event_schedule.start_time = program.conference.start_date.to_time) unless event_schedule.start_time.present?
unless program.selected_schedule.present?
schedule = create(:schedule, program: program)
program.schedules << schedule
program.selected_schedule = schedule
program.save!
unless event_schedule.schedule.present?
unless program.selected_schedule.present?
schedule = create(:schedule, program: program)
program.schedules << schedule
program.selected_schedule = schedule
program.save!
end
event_schedule.schedule = program.selected_schedule
end
event_schedule.schedule = program.selected_schedule
end
end
end