]> source.dussan.org Git - sonarqube.git/commitdiff
Fix issue when comparing profile due to rule enbabled column deletion
authorJulien Lancelot <julien.lancelot@gmail.com>
Fri, 15 Mar 2013 09:27:51 +0000 (10:27 +0100)
committerJulien Lancelot <julien.lancelot@gmail.com>
Fri, 15 Mar 2013 09:28:03 +0000 (10:28 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb

index c7f6a7797cd8d0be1243c7c5bf734de72118cf5a..54c62f613bf803d4e17253ae5260393f90d66f40 100644 (file)
@@ -326,18 +326,18 @@ class ProfilesController < ApplicationController
 
   # GET /profiles/compare?id1=<profile1 id>&id2=<profile2 id>
   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|