Re: Actionmailer Help Needed

Frederick Cheung
Fri, 29 Jul 2011 12:59:43 -0000

On Jul 29, 1:05 pm, Jenny Blunt
<li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.