aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-12-20 17:54:51 +0100
committerFabrice Bellingard <bellingard@gmail.com>2011-12-20 17:54:51 +0100
commit8bfaeb3585098baa8914fe10d8bcd219f6f65da1 (patch)
treeabdb56520baf5c91d9cbe4f3d5f10b8403c8b6ad
parenta3ce2f91fb4c9fbc46417daa22cfb107e39ca8a5 (diff)
parent431c4ccbe8d9b1f74f2b6a04ab1e60e112c06d27 (diff)
downloadsonarqube-8bfaeb3585098baa8914fe10d8bcd219f6f65da1.tar.gz
sonarqube-8bfaeb3585098baa8914fe10d8bcd219f6f65da1.zip
Merge remote branch 'upstream/master'
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb
index fc93e0f224c..ab6c1e84e58 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb
@@ -120,9 +120,9 @@ class Api::ProjectsController < Api::ApiController
def load_snapshots_by_project
select_columns='id,project_id,version,islast,created_at'
if params[:versions]=='true'
- snapshots=Snapshot.find_by_sql(["SELECT #{select_columns} FROM snapshots AS s1 WHERE s1.status=? AND s1.project_id IN (?) AND NOT EXISTS(SELECT * FROM snapshots AS s2 WHERE s2.project_id=s1.project_id AND s2.created_at>s1.created_at AND s2.version=s1.version)", 'P', @projects.map{|p| p.id}])
+ snapshots=Snapshot.find_by_sql(["SELECT #{select_columns} FROM snapshots s1 WHERE s1.status=? AND s1.project_id IN (?) AND NOT EXISTS(SELECT * FROM snapshots s2 WHERE s2.project_id=s1.project_id AND s2.created_at>s1.created_at AND s2.version=s1.version)", 'P', @projects.map{|p| p.id}])
elsif params[:versions]=='last'
- snapshots=Snapshot.find_by_sql(["SELECT #{select_columns} FROM snapshots AS s1 WHERE s1.status=? AND islast=? AND s1.project_id IN (?) AND NOT EXISTS(SELECT * FROM snapshots AS s2 WHERE s2.project_id=s1.project_id AND s2.created_at>s1.created_at AND s2.version=s1.version)", 'P', true, @projects.map{|p| p.id}])
+ snapshots=Snapshot.find_by_sql(["SELECT #{select_columns} FROM snapshots s1 WHERE s1.status=? AND islast=? AND s1.project_id IN (?) AND NOT EXISTS(SELECT * FROM snapshots s2 WHERE s2.project_id=s1.project_id AND s2.created_at>s1.created_at AND s2.version=s1.version)", 'P', true, @projects.map{|p| p.id}])
else
snapshots=[]
end