@@ -37,8 +37,10 class TrackersController < ApplicationController | |||
|
37 | 37 | if request.post? and @tracker.save |
|
38 | 38 | # workflow copy |
|
39 | 39 | if !params[:copy_workflow_from].blank? && (copy_from = Tracker.find_by_id(params[:copy_workflow_from])) |
|
40 |
|
|
|
41 | @tracker.workflows << w.clone | |
|
40 | Workflow.transaction do | |
|
41 | copy_from.workflows.find(:all, :include => [:role, :old_status, :new_status]).each do |w| | |
|
42 | Workflow.create(:tracker_id => @tracker.id, :role => w.role, :old_status => w.old_status, :new_status => w.new_status) | |
|
43 | end | |
|
42 | 44 | end |
|
43 | 45 | end |
|
44 | 46 | flash[:notice] = l(:notice_successful_create) |
General Comments 0
You need to be logged in to leave comments.
Login now