On Jul 29, 1:05 pm, Jenny Blunt <[email protected]> wrote:
> I've tried doing this in my tasks controller to list all users with
> upcoming tasks but it's not working...
>
>     @task = Task.all
>      @user = User.find(:all, :conditions => ["@task.dueddate <= ? AND
> @task.status = ?", Date.today + 7.days, false])
>
You would need to join the tasks table. Once you've done that,
remember that you conditions are an sql fragment so you can stick
conditions on tasks.duedate.
You'll also need to use group by  or disctinct to not get duplicate
users.

Another approach might be to just get all the overdue tasks and
collect their users (removing duplicates obviously)

Fred
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to