Permalink
Browse files

[ci skip] Improve callback code example for 4.1 upgrade docs.

The previous code example for the new explicit block requirement when
setting callbacks was a little confusing. This commit makes the example
more obvious.
  • Loading branch information...
1 parent 489e531 commit 9c3cb751f0ebf06d3ee15ae9c6279e49af9ee0e6 @nickpellant nickpellant committed Jul 7, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 guides/source/upgrading_ruby_on_rails.md
@@ -439,11 +439,11 @@ Rails 4.1 now expects an explicit block to be passed when calling
`ActiveSupport::Callbacks` being largely rewritten for the 4.1 release.
```ruby
-# Rails 4.1
-set_callback :save, :around, ->(r, block) { stuff; result = block.call; stuff }
-
-# Rails 4.0
+# Previously in Rails 4.0
set_callback :save, :around, ->(r, &block) { stuff; result = block.call; stuff }
+
+# Now in Rails 4.1
+set_callback :save, :around, ->(r, block) { stuff; result = block.call; stuff }
```
Upgrading from Rails 3.2 to Rails 4.0

0 comments on commit 9c3cb75

Please sign in to comment.