]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1974 fix a conflict of column names in the WS /api/violations
authorsimonbrandhof <simon.brandhof@gmail.com>
Sun, 4 Dec 2011 19:47:17 +0000 (20:47 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Sun, 4 Dec 2011 19:47:17 +0000 (20:47 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/violations_controller.rb

index 02be1887f6202a4eb164f51477db2f1905e5567e..027c86c17a1c4de4c5f9d822d75b7546c3eddf43 100644 (file)
@@ -64,7 +64,7 @@ class Api::ViolationsController < Api::ResourceRestController
       rule_ids=params[:rules].split(',').map do |key_or_id|
         Rule.to_i(key_or_id)
       end.compact
-      conditions << 'rule_id IN (:rule_ids)'
+      conditions << 'rule_failures.rule_id IN (:rule_ids)'
       values[:rule_ids] = rule_ids
     end
     if params[:priorities]
@@ -75,10 +75,10 @@ class Api::ViolationsController < Api::ResourceRestController
     end
     
     if params[:switched_off] == "true"
-      conditions << 'switched_off=:switched_off'
+      conditions << 'rule_failures.switched_off=:switched_off'
       values[:switched_off] = true
     else
-      conditions << '(switched_off IS NULL OR switched_off=:switched_off)'
+      conditions << '(rule_failures.switched_off IS NULL OR rule_failures.switched_off=:switched_off)'
       values[:switched_off] = false
     end