From 0551d1e10ec50c2952e8127a3d747ad965170a5d Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 7 May 2008 18:37:20 +0000 Subject: [PATCH] count with conditions for AR2 git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@159 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/controllers/tag_images_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tag_images_controller.rb b/app/controllers/tag_images_controller.rb index afe5155..140bc83 100644 --- a/app/controllers/tag_images_controller.rb +++ b/app/controllers/tag_images_controller.rb @@ -78,7 +78,7 @@ class TagImagesController < ApplicationController conditions = [ cond_ary.join(' AND '), cond_var ] @current_page = params[:page].to_i @current_page = 1 if @current_page == 0 - image_count = TagImage.count(conditions) + image_count = TagImage.count(:conditions => conditions) @page_count = (image_count.to_f / images_per_page.to_f).round @page_count = 1 if @page_count == 0 @tagged_images = TagImage.find :all, :limit => images_per_page,