I'm wondering how does one implement a cron job like feature in rails.
For instance, you have a member model. My system sends a SMS welcome message each time a new member sign up. However, if this user has been greeted before, don't send it again. Thus, each 10 minutes I'd like to look into the member table, and see who shall I send the message to.
This is simply an example, and I'm aware it's easier to implement otherwise. However I'd like to know if for a cron job like task, which has to look into the active records
1) where shall I put the script? 2) is it a good practice to access the db via active records directly? 3) shall I use a gem like whenever? or in this situation would be easier to implement just using system cron?
Thanks!
rake greet_new_member
) and use cron to run this task every 10 minutes?