Only replace selected schedule if there is none
We have introduced this task a long time ago without any release. In the meantime there might be people who have deployed, hence have selected schedules already. Happened to openSUSE.
This commit is contained in:
parent
1e5558660f
commit
f9442bd07d
1 changed files with 2 additions and 2 deletions
|
|
@ -6,8 +6,8 @@ namespace :data do
|
||||||
task move_events_attributes: :environment do
|
task move_events_attributes: :environment do
|
||||||
Program.all.each do |program|
|
Program.all.each do |program|
|
||||||
schedule = Schedule.create(program: program)
|
schedule = Schedule.create(program: program)
|
||||||
program.selected_schedule = schedule
|
program.selected_schedule = schedule unless program.selected_schedule
|
||||||
program.save
|
program.save!
|
||||||
program.events.each do |event|
|
program.events.each do |event|
|
||||||
unless event.start_time.nil? && event.room_id.nil?
|
unless event.start_time.nil? && event.room_id.nil?
|
||||||
# we can not use .room as this relation has been removed
|
# we can not use .room as this relation has been removed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue