]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2421 Review WS API is limited to "VIOLATION" by default
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 19 May 2011 13:39:37 +0000 (15:39 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 19 May 2011 13:39:37 +0000 (15:39 +0200)
By default when using the reviews web service API, search is
limited to "VIOLATION" whereas this should not be the case.

sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/models/review.rb

index 62b3f3b87596ef48c26b4b2783506cbbeaeb7f58..48bcf107ba74f7a627f47fb34b8d5072b481d709 100644 (file)
@@ -308,7 +308,7 @@ class ReviewsController < ApplicationController
   end
 
   def search_reviews
-    options = {}
+    options = {'review_type' => 'VIOLATION'}
     unless @statuses == ['']
       options['statuses']=@statuses.join(',')
     end
index 46e97ba9c955cf96d8c8d9c3181761b68c11a5a4..8405f6f96621584ecdba7b021da1e63cba769b31 100644 (file)
@@ -53,13 +53,10 @@ class Review < ActiveRecord::Base
     conditions=[]
     values={}
       
-    review_type = options['review_type']
-    if review_type
-      conditions << 'review_type=:type'
-      values[:type] = review_type.upcase
-    else
-      conditions=['review_type<>:not_type']
-      values={:not_type => Review::TYPE_FALSE_POSITIVE}
+    review_type = options['review_type'].split(',') if options['review_type']
+    if review_type && review_type.size>0 && !review_type[0].blank?
+      conditions << 'review_type in (:review_type)'
+      values[:review_type]=review_type
     end
     
     ids=options['ids'].split(',') if options['ids']