# Paginate\_find affects subsequent find\_by\_name

**URL:** <https://www.ruby-forum.com/t/paginate-find-affects-subsequent-find-by-name/127052>\
**Category:** Rails\
**Created:** [January 24, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/paginate-find-affects-subsequent-find-by-name/127052 "2008-01-24T16:55:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://www.ruby-forum.com/u/peter)\
**Post date:** [January 24, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/paginate-find-affects-subsequent-find-by-name/127052/1 "2008-01-24T16:55:35Z")

</div>

Hi  
I am trying to add pagination to my noddy blog.

I installed the paginate\_find plugin (manually because I had (firewall?)  
problems). It was a straight copy into vendor as far as I can see.

Anyway when I add :page to my index find it magically affects a  
follow-up  
find\_by\_name so that the find\_by\_name returns nil.

@posts = Post.find(:all,  
:page =\> {:size =\> 10, :current =\> params[:page]}, # new :page line  
:include=\>:tags,  
:conditions =\> [conditions.join(’ AND '),  
params],:order =\> ‘posts.datetime desc’)

@posts.each do |post|  
post.text.gsub!( /[embed,.+?]/ ) do |s|  
m=s.split(/,|[|]/)

if not m.nil?  
pic = Picture.find\_by\_name(m[2]) # finds no records when :page  
added above  
…  
end  
end

I have tried replacing find\_by\_name with a generic find using a name  
parameter.  
Did not help

This looks like a bug in paginate\_find at the moment.

Peter

actionmailer (2.0.1, 1.3.5)  
actionpack (2.0.1, 1.13.5)  
actionwebservice (1.2.5)  
activerecord (2.0.1, 1.15.5)  
activeresource (2.0.1)  
activesupport (2.0.1, 1.4.4)  
acts\_as\_ferret (0.4.3)  
ferret (0.11.5)  
fxri (0.3.6)  
fxruby (1.6.12)  
hpricot (0.6)  
log4r (1.0.5)  
rails (1.2.5)  
rake (0.7.3, 0.5.4)  
rcov (0.8.1.2.0)  
RMagick-win32 (1.7.0)  
rubygems-update (0.9.5)  
sources (0.0.1)  
win32-api (1.0.0)  
win32-clipboard (0.4.3)  
win32-dir (0.3.2)  
win32-eventlog (0.4.6)  
win32-file (0.5.4)  
win32-file-stat (1.2.5)  
win32-process (0.5.3)  
win32-sapi (0.1.4)  
win32-sound (0.4.1)  
windows-api (0.2.0)  
windows-pr (0.7.1)
