We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Better callbacks in Rails 5

Formal Metadata

Title
Better callbacks in Rails 5
Title of Series
Part Number
24
Number of Parts
94
Author
License
CC Attribution - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
In Rails 5, the old way of returning false to implicitly halt a callback chain will not work anymore. This change will impact any codebase using ActiveSupport, ActiveRecord, ActiveModel or ActiveJob. Methods like before_action, before_save, before_validation will require developers to explicitly throw an exception in order the halt the chain. This talk will explain the motivations behind the new default, will delve into the internals of Rails to show the actual code, and will help developers and gem maintainers safely upgrade their apps to Rails 5.