[Borges-users] BatchedList bugs
Kaspar Schiess
eule at space.ch
Sat Mar 20 01:09:39 EST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all,
BatchedList as of CVS today suffers from several bugs:
- - max_pages is often off by one (should round up not down)
- - if on last page, down button (<<) does not work
patch attached.
kaspar - code philosopher
- -- stolen off the net --
Okay, "splurk" isn't exactly unpronouncable, but it IS short and
pretentious, and suffers delusions of looking good in purple...
-- Peter Morrison, in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAW4vDh6tlx0BWOuARAvI5AJ4yJB40cS+ASMhxhBih72HsKCSYbACeM17W
r0HhoLuIInyMxoDDrytsC48=
=PEuv
-----END PGP SIGNATURE-----
-------------- next part --------------
--- BatchedList.rb Sat Mar 20 01:06:03 2004
+++ c:\unix\ruby\lib\ruby\site_ruby\1.8\Borges\Component\BatchedList.rb Sat Mar 20 00:57:10 2004
@@ -64,7 +64,7 @@
# The maximum number of pages (indexed from 1)
def max_pages
- return @items.size / @batch_size
+ return (@items.size+ at batch_size-1) / @batch_size
end
##
@@ -92,7 +92,7 @@
# Move to the previous page in the batch.
def previous_page
- @current_page -= 1 unless on_last_page?
+ @current_page -= 1 unless on_first_page?
end
##
More information about the Borges-users
mailing list