#43 ✓invalid
James Herdman

Operand should contain 1 column(s)

Reported by James Herdman | June 26th, 2007 @ 05:09 AM

I have a model like this

class Admin < User
  has_many :places, :finder_sql => 'SELECT * FROM places' do
    def find(*args)

  # etc

Note the has_many extension. If I try to use any finder method it works just fine. However, paginate is puking:

> a = Admin.find(:first)
=> ( some admin object )
> a.places.find(:all)
=> ( lots and lots of results )
> a.places.paginate(:all, :page => 1)
ActiveRecord::StatementInvalid: Mysql::Error: Operand should contain 1 column(s): SEL
ECT count(*) AS count_all FROM places WHERE (( SELECT * FROM places ) AND ( places.de
leted_at IS NULL OR places.deleted_at > '2007-06-21 18:43:54' )) 

This same error occurs if I manually specify the counter_sql option as well.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket