]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2701 If there's only 1 snapshot, it shouldn't be printed twice
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 21 Sep 2011 11:52:58 +0000 (13:52 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 21 Sep 2011 11:54:58 +0000 (13:54 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb

index ab8a024f9c3397d1936a54e1dfc21a2b278ef027..7b5f9034fab514bbb5e911d217852a925862488f 100644 (file)
@@ -83,6 +83,10 @@ class Snapshot < ActiveRecord::Base
     first_snapshot=Snapshot.find(:first, :conditions => snapshot_conditions, :order => 'snapshots.created_at ASC')
     last_snapshot=resource.last_snapshot
     
+    if first_snapshot==last_snapshot
+      return [last_snapshot]
+    end
+    
     # Look for the number_of_columns-2 last snapshots to display  (they must have 'Version' events)
     version_snapshots = []
     if number_of_columns > 2