Thanks
On Aug 28, 1:41 pm, javier ramirez
<jrami...-7iWCczGtl7hBDgjK7y7TUQ@public.gmane.org>
wrote:> Hi,>> One way to do this is just to create a ruby script which
includes the
> >> rails environment, loads the record using active record, and sends
an
> >> email using active mailer. Then have cron run that script
> >> periodically.
>
> > This is probably the best way to go.
>
> You could do this pretty neatly by using rake. You only need to create a
> task and then use rake for invoking it. In your case you could do it by
> hand or via cron. If you include ''environment'' as a
dependency for your
> task, then your rails environment will be loaded for you and you can
> access your models as usual. It''s easy, it''s clean,
it''s descriptive as
> it will be listed under rake -T and it''s easy to launch from the
command
> line.
>
> If for any reason you prefer a script and not a task (not sure why
you''d
> actually want it), then you don''t need to care about how to load
the
> enviroment or whatever. You can invoke any script with script/runner and
> the rails boot-up sequence will be executed before calling your script,
> so you can also here access your models as always.
>
> regards,
>
> javier ramirez
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---