Project

General

Profile

Defect #2701 ยป tracker_role_custom_table_prefix.patch

fix tracker.rb and role.rb to handle custom table prefix - Stefan Urbanek, 2009-02-09 12:11

View differences:

tracker.rb (working copy)
23 23
      raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
24 24
      raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
25 25
      clear
26
      connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
26
      connection.insert "INSERT INTO #{Workflows.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
27 27
                        " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
28
                        " FROM workflows" +
28
                        " FROM #{Workflows.table_name}" +
29 29
                        " WHERE tracker_id = #{tracker.id}"
30 30
    end
31 31
  end
role.rb (working copy)
31 31
      raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role)
32 32
      raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record?
33 33
      clear
34
      connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
34
      connection.insert "INSERT INTO #{Workflows.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
35 35
                        " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" +
36
                        " FROM workflows" +
36
                        " FROM #{Workflows.table_name}" +
37 37
                        " WHERE role_id = #{role.id}"
38 38
    end
39 39
  end
    (1-1/1)