I would like to create a Rake task that:
- checks a column in a table row
- and if its value is false, sends an email with the row information,
- and then change the value from false to true.
Does anyone know the best way to approach this?
I would like to create a Rake task that:
Does anyone know the best way to approach this?
Write the code to
After you put this code in a rake task and launch this task
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.