From e471c3a209e78642e62c9510b881f233a3be0145 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 15 Mar 2013 10:27:51 +0100 Subject: [PATCH] Fix issue when comparing profile due to rule enbabled column deletion --- .../WEB-INF/app/controllers/profiles_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb index c7f6a7797cd..54c62f613bf 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb @@ -326,18 +326,18 @@ class ProfilesController < ApplicationController # GET /profiles/compare?id1=&id2= def compare - @profiles = Profile.find(:all, :order => 'language asc, name') + @profiles = Profile.all(:order => 'language asc, name') if params[:id1].present? && params[:id2].present? @profile1 = Profile.find(params[:id1]) @profile2 = Profile.find(params[:id2]) - arules1 = ActiveRule.find(:all, :include => [{:active_rule_parameters => :rules_parameter}, :rule], + arules1 = ActiveRule.all(:include => [{:active_rule_parameters => :rules_parameter}, :rule], :conditions => ['active_rules.profile_id=?', @profile1.id]) - arules2 = ActiveRule.find(:all, :order => 'rules.plugin_name, rules.plugin_rule_key', :include => [{:active_rule_parameters => :rules_parameter}, :rule], + arules2 = ActiveRule.all(:order => 'rules.plugin_name, rules.plugin_rule_key', :include => [{:active_rule_parameters => :rules_parameter}, :rule], :conditions => ['active_rules.profile_id=?', @profile2.id]) - arules1.reject! { |arule| !arule.rule.enabled } - arules2.reject! { |arule| !arule.rule.enabled } + arules1.reject! { |arule| arule.rule.removed? } + arules2.reject! { |arule| arule.rule.removed? } diffs_by_rule={} arules1.each do |arule1| -- 2.39.5