Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw abort in before_save callbacks #2

Conversation

merodriguezblanco
Copy link
Contributor

Hi @zacharywelch ,

while upgrading one of my rails-apis to Rails 5.0, I noticed that callbacks must be halted differently.

Returning false in a before_* callback will not halt the execution for Rails version >= 5.1 according to this PR. You should throw(:abort) instead.

I added a conditional that checks for AM version. Let me know your thoughts :)

@zacharywelch
Copy link
Owner

nice, thanks! 🎩 👍

@zacharywelch zacharywelch merged commit fbffe6f into zacharywelch:master Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants