ruby - When to Use Rake Tasks in Rails -


i'm confused on whether rails way place code in rake task or in model.

  1. i have code run background job send email user if 1 of friends had activity day
  2. 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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -