From 37a655ada80cfe64ba883d04f9e76736a79b3501 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 19 May 2011 15:39:37 +0200 Subject: [PATCH] SONAR-2421 Review WS API is limited to "VIOLATION" by default By default when using the reviews web service API, search is limited to "VIOLATION" whereas this should not be the case. --- .../WEB-INF/app/controllers/reviews_controller.rb | 2 +- .../src/main/webapp/WEB-INF/app/models/review.rb | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb index 62b3f3b8759..48bcf107ba7 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb @@ -308,7 +308,7 @@ class ReviewsController < ApplicationController end def search_reviews - options = {} + options = {'review_type' => 'VIOLATION'} unless @statuses == [''] options['statuses']=@statuses.join(',') end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb index 46e97ba9c95..8405f6f9662 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb @@ -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'] -- 2.39.5