aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-04-11 19:02:11 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-04-11 19:02:11 +0200
commitc8278a1e6bca00368405a760b3ab8d0d4c32f146 (patch)
treeeb4ffa1006da3fd5e4dd78335b9160c1f6d150d9 /sonar-server
parentb7017a2ddcc24d706ce5be0b2e15ede4cbef2022 (diff)
downloadsonarqube-c8278a1e6bca00368405a760b3ab8d0d4c32f146.tar.gz
sonarqube-c8278a1e6bca00368405a760b3ab8d0d4c32f146.zip
SONAR-3404 do not limit search of reviews by default (was 200).
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/review.rb3
3 files changed, 4 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb
index 2f339ca6457..e7ff73455d3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb
@@ -40,7 +40,7 @@ class Api::ReviewsController < Api::ApiController
# - 'assignees'
#
def index
- reviews=select_authorized(:user, Review.search(params), :project)
+ reviews=select_authorized(:user, Review.search(params.merge({'limit' => 500})), :project)
render_reviews(reviews, params[:output] == 'HTML')
end
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 b6325df13f3..2342c9eb750 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
@@ -313,6 +313,7 @@ class ReviewsController < ApplicationController
end
options['sort'] = @sort unless @sort.blank?
options['asc'] = @asc
+ options['limit']=500
found_reviews = Review.search(options)
@reviews = select_authorized(:user, found_reviews, :project)
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 cac8b35f2af..84dc10032fc 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
@@ -259,6 +259,7 @@ class Review < ActiveRecord::Base
def self.search(options={})
conditions=[]
values={}
+ no_need_for_db_request = false
if options['id'].present?
conditions << 'id=:id'
@@ -392,7 +393,7 @@ class Review < ActiveRecord::Base
end
found_reviews = []
- found_reviews = Review.find(:all, :include => ['review_comments', 'project', 'assignee', 'resource', 'user'], :conditions => [conditions.join(' AND '), values], :order => sort, :limit => 200) unless no_need_for_db_request
+ found_reviews = Review.find(:all, :include => ['review_comments', 'project', 'assignee', 'resource', 'user'], :conditions => [conditions.join(' AND '), values], :order => sort, :limit => options['limit']) unless no_need_for_db_request
found_reviews
end