]> source.dussan.org Git - redmine.git/commitdiff
SQLServer: rule is a reserved keyword (#12713).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Jan 2013 11:21:45 +0000 (11:21 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Jan 2013 11:21:45 +0000 (11:21 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11099 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/workflow_rule.rb

index 2fc020ba1562e53c5a9f0f00bd5041855140ab00..9abc152282837df262ac0b1c4d4276d377c3fa7b 100644 (file)
@@ -62,8 +62,8 @@ class WorkflowRule < ActiveRecord::Base
     else
       transaction do
         delete_all :tracker_id => target_tracker.id, :role_id => target_role.id
-        connection.insert "INSERT INTO #{WorkflowRule.table_name} (tracker_id, role_id, old_status_id, new_status_id, author, assignee, field_name, rule, type)" +
-                          " SELECT #{target_tracker.id}, #{target_role.id}, old_status_id, new_status_id, author, assignee, field_name, rule, type" +
+        connection.insert "INSERT INTO #{WorkflowRule.table_name} (tracker_id, role_id, old_status_id, new_status_id, author, assignee, field_name, #{connection.quote_column_name 'rule'}, type)" +
+                          " SELECT #{target_tracker.id}, #{target_role.id}, old_status_id, new_status_id, author, assignee, field_name, #{connection.quote_column_name 'rule'}, type" +
                           " FROM #{WorkflowRule.table_name}" +
                           " WHERE tracker_id = #{source_tracker.id} AND role_id = #{source_role.id}"
       end