views:

17

answers:

2

I would like to create a Rake task that:

  1. checks a column in a table row
  2. and if its value is false, sends an email with the row information,
  3. and then change the value from false to true.

Does anyone know the best way to approach this?

A: 

Write the code to

  1. checks a column in a table row
  2. and if its value is false, sends an email with the row information,
  3. and then change the value from false to true.

After you put this code in a rake task and launch this task

shingara
why this downvote, there are no more to say :(
shingara
Are there examples? Are there plugins? How should this be approached? Is my activity flow above substantial then? If so, why not just say that?
aaronmase
there are no answer than you need code it because it's specific to your case. There are not always a plugin. Sometimes you need write code
shingara
I'll write my own reply then as you are not helpful. "sometimes you need to just not say anything"
aaronmase
or not ask some no really question
shingara
I don't understand?
aaronmase
your question can be not asking.
shingara
huh? don't understand still, please rephrase
aaronmase
A: 

Does anyone know the best way to approach this?

The best way is to create a background rake task using the whenever gem. Use this to check for model instances that have the false column. Create a view template as the basis for the email message and update this with the appropriate information in the rake task. When the e-mail has been sent with success, update the model instances.

aaronmase