4 ms·
As always, the question is should be in Rails or not. I think that the answer is clear, this should not be a part of rails since it's not true to all apps. I
by avitzurel 13y ago
As always, the question is should be in Rails or not.
I think that the answer is clear, this should not be a part of rails since it's not true to all apps.
I think that if you want to have something real quick, you don't need an interactor/service class.
When you have a bigger app, you definitely need that, or you will get to a point where you code is split into models/observers/callbacks/lib/app/concerns and you can't find anything.
Rails generators are pretty easy to extend, this way, when you generate a new model, you can easily create the service class for it.
You can also EASILY create new generators that will generate the service classes for you with your defaults and templates and what not.
Not sure Rails is missing that, however, it is definitely a best practice that people with bigger apps should use TODAY.
- ryanbrunner 13y agoMailers, concerns, helpers, observers and a lot of other things in Rails aren't universally used by all apps. Even something as simple as an empty directory and some generators in a stock Rails app would go a long way in educating people that these are patterns that you can use / provide a common language for where these sorts of things should go and what we should call them.