@@ -31,9 +31,9 class Role < ActiveRecord::Base | |||||
31 | raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role) |
|
31 | raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role) | |
32 | raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record? |
|
32 | raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record? | |
33 | clear |
|
33 | clear | |
34 |
connection.insert "INSERT INTO |
|
34 | connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" + | |
35 | " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" + |
|
35 | " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" + | |
36 |
" FROM |
|
36 | " FROM #{Workflow.table_name}" + | |
37 | " WHERE role_id = #{role.id}" |
|
37 | " WHERE role_id = #{role.id}" | |
38 | end |
|
38 | end | |
39 | end |
|
39 | end |
@@ -23,9 +23,9 class Tracker < ActiveRecord::Base | |||||
23 | raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker) |
|
23 | raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker) | |
24 | raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record? |
|
24 | raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record? | |
25 | clear |
|
25 | clear | |
26 |
connection.insert "INSERT INTO |
|
26 | connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" + | |
27 | " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" + |
|
27 | " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" + | |
28 |
" FROM |
|
28 | " FROM #{Workflow.table_name}" + | |
29 | " WHERE tracker_id = #{tracker.id}" |
|
29 | " WHERE tracker_id = #{tracker.id}" | |
30 | end |
|
30 | end | |
31 | end |
|
31 | end |
General Comments 0
You need to be logged in to leave comments.
Login now