I don’t think that the query is correct then.

 

The original query was

 

        @down_count = Todo.count(

          :all, 

          :conditions => ['todos.user_id = ? and todos.state = ? and 
contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', 
current_user.id, 'active', false, 'active'], 

          :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", 

          :include => [ :project, :context ])

 

Looking more closely, the :order is not necessary, probably a copy-and-paste 
error. 

Perhaps changing the query into 

 

        @down_count = Todo.count(

          :all, 

          :conditions => ['todos.user_id = ? and todos.state = ? and 
contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', 
current_user.id, 'active', false, 'active'], 

          :group => “todos.id”,

          :include => [ :project, :context ])

 

Will work?

 

Reinier

 

Van: Walter Cruz [mailto:[EMAIL PROTECTED] 
Verzonden: zondag 6 april 2008 17:11
Aan: Reinier Balt
CC: [email protected]
Onderwerp: Re: [Tracks-discuss] problem with postgres and version

 

Tested:
Adding 

:group => ['todos.due, todos.created_at'] solves it, but don't know if brings 
the right answer :(

[]'s
- Walter

_______________________________________________
Tracks-discuss mailing list
[email protected]
http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss

Reply via email to