public
Rubygem
Description: Don't mind this, go to http://github.com/integrity/integrity
Homepage: http://integrityapp.com
Clone URL: git://github.com/foca/integrity.git
Change the way Project#previous_builds is calculated

Probably a performance gain, but it doesn't matter -- it should save us
from count/size weirdness =)
foca (author)
Thu Nov 20 15:45:39 -0800 2008
commit  61618239f2001ca86c5e246f6b5345d282026c1e
tree    808e3e090ac8e7d4ff34ec189dd7ca08133f3c2f
parent  d0e298e3b50eb88a7a8b3495580235704983c264
...
35
36
37
38
39
 
 
 
40
41
42
...
35
36
37
 
 
38
39
40
41
42
43
0
@@ -35,8 +35,9 @@ module Integrity
0
     end
0
 
0
     def previous_builds
0
-      return [] if builds.size <= 1
0
-      builds.all(:order => [:created_at.desc], :offset => 1, :limit => builds.size - 1)
0
+      builds.all(:order => [:created_at.desc]).tap do |builds|
0
+        builds.shift
0
+      end
0
     end
0
 
0
     def status

Comments