simplify
This commit is contained in:
parent
c40f42db19
commit
5d85864dbf
1 changed files with 3 additions and 5 deletions
|
@ -32,11 +32,9 @@ namespace :after_party do
|
||||||
cloned_procedure_dossiers.each { _1.update(revision_id: new_revision.id) }
|
cloned_procedure_dossiers.each { _1.update(revision_id: new_revision.id) }
|
||||||
puts "Update dossiers #{cloned_procedure_dossiers.map(&:id)} for procedure: #{cloned_procedure.id}"
|
puts "Update dossiers #{cloned_procedure_dossiers.map(&:id)} for procedure: #{cloned_procedure.id}"
|
||||||
|
|
||||||
revisions = cloned_procedure
|
foreign_revision.update(procedure_id: parent_procedure.id)
|
||||||
.revisions
|
|
||||||
.where(id: foreign_revision.id)
|
puts "Update revision #{foreign_revision.id} for procedure: #{cloned_procedure.id}"
|
||||||
revisions.update_all(procedure_id: parent_procedure.id)
|
|
||||||
puts "Update revisions #{revisions.map(&:id)} for procedure: #{cloned_procedure.id}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue