3 ms·
Enough with the Service Objects Already
- tarr11 9y agoThere needs to be a reason to refactor this stuff out. Usually that reason is that you need to use it somewhere else. I am not a huge fan of refactoring simply to enable tests. The initial method (with logic in the controller) was longer to read, but I still could quickly understand all the dependencies (mailer, database, etc) With the new method, if it's a service object, module, concern or whatever, the implementation is now obscured and I have to look in two separate places. That should be considered into any decision before simply trying to make your code look "cleaner".