DEV Community

Discussion on: Working Around ActiveRecord Callbacks

Collapse
 
supergoodjared profile image
Jared Norman

The term "service object" is pretty overloaded and means a lot of things to different people, but it's still my goto technique for managing this particular kind of complexity.

Alternatively, if you app is still very CRUD-y, wrapping things like "address creation" in their own special ActiveModel::Model object can be really nice since you can still interact with it roughly the same way you would any other resource. It's certainly a nice option especially for less complex apps that don't necessarily have a preferred pattern for pulling out logic into POROs.