ruby - When to Use Rake Tasks in Rails -
i'm confused on whether rails way place code in rake task or in model.
- i have code run background job send email user if 1 of friends had activity day
- i'm using whenever gem schedule execution of method/task allows me run code either model or rake task
can me newbie question of if rails way put background job-only code in model or rake task?
this nothing rails way object oriented programming. should place behavior @ class can use form every place in app. if place @ rake task have behavior there. , kind of rake task should know how should model or other class. example if want use resque in future changes code easier if have inside of class , not locked inside rake task.
Comments
Post a Comment