# Joins with paginate syntax problem

**URL:** <https://www.ruby-forum.com/t/joins-with-paginate-syntax-problem/142549>\
**Category:** Rails\
**Created:** [July 9, 2008, 3:02am UTC](https://www.ruby-forum.com/t/joins-with-paginate-syntax-problem/142549 "2008-07-09T03:02:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffpritchard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/43a26b/32.png) [@jeffpritchard](https://www.ruby-forum.com/u/jeffpritchard)\
**Post date:** [July 9, 2008, 3:02am UTC](https://www.ruby-forum.com/t/joins-with-paginate-syntax-problem/142549/1 "2008-07-09T03:02:10Z")

</div>

First, let me just say “YES, I KNOW, I SHOULD BE USING WILL PAGINGATE  
INSTEAD”.

Now, with that out of the way, and assuming that I have some reason  
(stubornness, laziness, whatever) to keep using paginate on this old  
project in 1.2 rails…

I’m trying to set up my conditions with a “joins” parameter. I have a  
join table which follows the active record expectation for a habtm  
association, which is unfortunately inconsistent pluralization wise with  
a regular table name. the join table is called “events\_owners”, so it  
is plural and that seems to screw things up with the conditions.

Here’s my code right now…  
@events\_for\_reports\_pages, @events\_for\_reports = paginate :events,  
:joins =\> :events\_owners,  
:conditions =\> [“events\_owners.owner\_id=?” , @owner.id],  
:order =\> :created\_at,  
:per\_page =\> 50

Here’s the error I get back:  
Mysql::Error: Unknown column ‘events\_ownerss.owner\_id’ in ‘where  
clause’: SELECT count(\*) AS count\_all FROM events events\_owners WHERE  
(events\_ownerss.owner\_id=1)

Any ideas? I think it is because the events\_owners table is pluralized,  
where as a normal table isn’t, but maybe it is something else.

thanks,  
jp
