Open olivierobert opened 5 years ago
At first, I intended to move logic to be a function inside each model to make the code readability (separate from controller and make controller to be clean).
However, since process_search is used in Rails task so I decided to moved it out.
To be true to single responsibility, prefer moving out
process_search
from the modelKeywordData
.A specific Job or Service class would be a great solution.
ActiveRecord models do usually quite a lot already as they manage both entity definition and data persistence. So let's not add more responsibilities there. It would help greatly in code maintenance and testing.