This project is archived and is in readonly mode.

#4811 ✓resolved
Darren Hinderer

count before where fails

Reported by Darren Hinderer | June 9th, 2010 @ 05:29 PM

The active record querying rails guide gives this example of querying:
Client.count.where("clients.first_name = 'Ryan' AND orders.status = 'received'").includes("orders")

However when I do that I get the error:
undefined method where' for Fixnum

Which means to me that it is doing the count before taking into account the where. I don't know if this is a bug or not. For now I'll just move my count method to after the where.

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>