Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Changes callbacks to method calls in controller actions. #8

Merged
merged 1 commit into from
Jul 1, 2015

Conversation

philnash
Copy link
Contributor

This is a personal preference, but one that I believe many other developers are
following too. Callbacks on models can hide the complexity that is happening in
a controller action. Making the calls explicitly within the action shows exactly
what that action is up to. Other things this helps with are tests or admin
actions, where you don't get unintended side effects if you create an object
outside of its normal life. There are some blog posts on this, for example
here and here.

This is a personal preference, but one that I believe many other developers are
following too. Callbacks on models can hide the complexity that is happening in
a controller action. Making the calls explicitly within the action shows exactly
what that action is up to. Other things this helps with are tests or admin
actions, where you don't get unintended side effects if you create an object
outside of its normal life. There are some blog posts on this, for example
[here](http://adequate.io/culling-the-activerecord-lifecycle) and [here](https://www.reinteractive.net/posts/130-activerecord-callbacks-considered-harmful).
@jarodreyes jarodreyes merged commit 161577f into TwilioDevEd:master Jul 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants