From c3ff8be1248d1c1d2e61f73aaa7d1a41cc6b4b8f Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 1 Feb 2008 05:47:51 +0000 Subject: [PATCH] better rounding git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@109 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/controllers/tag_images_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/tag_images_controller.rb b/app/controllers/tag_images_controller.rb index 3e145fc..4039696 100644 --- a/app/controllers/tag_images_controller.rb +++ b/app/controllers/tag_images_controller.rb @@ -74,8 +74,7 @@ class TagImagesController < ApplicationController @current_page = params[:page].to_i @current_page = 1 if @current_page == 0 image_count = TagImage.count(conditions) - @page_count = (image_count.to_f / per_page.to_f + 0.5).to_i - @page_count = 1 if @page_count == 0 and image_count >= 0 + @page_count = (image_count.to_f / images_per_page.to_f).round @tagged_images = TagImage.find :all, :limit => images_per_page, :conditions => conditions, :order => 'created_at ASC', :offset => ((@current_page - 1) * images_per_page),