From bd993108b2fb348774e6178c19f9e7f9cbda145d Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 21 Aug 2013 10:39:03 +0200 Subject: [PATCH] SONAR-4569 Add some comments in code --- .../WEB-INF/app/controllers/bulk_deletion_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb index 6dc2c3fd0ea..b4c2f9c12be 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb @@ -33,8 +33,9 @@ class BulkDeletionController < ApplicationController @selected_tab = params[:resource_type] @selected_tab = 'TRK' unless @tabs.include?(@selected_tab) - + # Search for resources having snapshot with islast column to true + # SONAR-4569 conditions = "resource_index.qualifier=:qualifier AND projects.qualifier=:qualifier AND projects.enabled=:enabled AND snapshots.islast=:islast" values = {:qualifier => @selected_tab, :enabled => true, :islast => true} if params[:name_filter] && !params[:name_filter].blank? @@ -64,6 +65,7 @@ class BulkDeletionController < ApplicationController :select => 'project_id', :conditions => [conditions + " AND project_id IN (:pids)", values.merge({:status => Snapshot::STATUS_PROCESSED, :pids => unprocessed_project_ids})]).map(&:project_id).uniq + # SONAR-4569 # Detect active projects without any snapshots or with no snapshot having islast column to true projects_not_having_snapshots_islast_to_true = Project.find_by_sql ["SELECT p.id FROM projects p WHERE p.enabled=? AND p.scope=? AND p.qualifier IN (?) AND NOT EXISTS (SELECT id FROM snapshots WHERE islast=? and project_id=p.id)", -- 2.39.5