From: Jean-Philippe Lang Date: Sat, 16 Jul 2016 09:52:04 +0000 (+0000) Subject: Don't pass conditions to #destroy_all. X-Git-Tag: 3.4.0~791 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=be5126ee13ccef8c1e84d1d8be2723dbfc3b5e7d;p=redmine.git Don't pass conditions to #destroy_all. git-svn-id: http://svn.redmine.org/redmine/trunk@15672 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/workflow_permission.rb b/app/models/workflow_permission.rb index 1990b826b..39e2f3bef 100644 --- a/app/models/workflow_permission.rb +++ b/app/models/workflow_permission.rb @@ -46,7 +46,7 @@ class WorkflowPermission < WorkflowRule transaction do permissions.each { |status_id, rule_by_field| rule_by_field.each { |field, rule| - destroy_all(:tracker_id => trackers.map(&:id), :role_id => roles.map(&:id), :old_status_id => status_id, :field_name => field) + where(:tracker_id => trackers.map(&:id), :role_id => roles.map(&:id), :old_status_id => status_id, :field_name => field).destroy_all if rule.present? trackers.each do |tracker| roles.each do |role|