mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
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
|
||||
Program.all.each do |program|
|
||||
schedule = Schedule.create(program: program)
|
||||
program.selected_schedule = schedule
|
||||
program.save
|
||||
program.selected_schedule = schedule unless program.selected_schedule
|
||||
program.save!
|
||||
program.events.each do |event|
|
||||
unless event.start_time.nil? && event.room_id.nil?
|
||||
# we can not use .room as this relation has been removed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue