justin808/fat-code-refactoring-techniques — pull request #15 by justin808 (2014-04-20 08:52:15+00:00)
Title: Rails Conf: Business logic in model

Refactored fat, complicated, full-of-business MicropostController create action so that business logic resides in models.

* Leverage validation on Micropost
* Created method Micropost#save_with_profanity_callbacks to handle the business logic aspects.
* Considered putting this logic in the after_save hook for Micropost, but I'd rather not invoke complicated business logic from a hook.