aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/upgrading_ruby_on_rails.md
diff options
context:
space:
mode:
authorNick Pellant <nick@nickpellant.com>2014-07-07 13:24:26 +0100
committerNick Pellant <nick@nickpellant.com>2014-07-07 13:24:26 +0100
commit9c3cb751f0ebf06d3ee15ae9c6279e49af9ee0e6 (patch)
tree4c51f77e282e394c53a3fd9d958fcc7078f19890 /guides/source/upgrading_ruby_on_rails.md
parent489e531334bc448c88f9b5a74f1bbbcaeb3f067b (diff)
downloadrails-9c3cb751f0ebf06d3ee15ae9c6279e49af9ee0e6.tar.gz
rails-9c3cb751f0ebf06d3ee15ae9c6279e49af9ee0e6.tar.bz2
rails-9c3cb751f0ebf06d3ee15ae9c6279e49af9ee0e6.zip
[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.
Diffstat (limited to 'guides/source/upgrading_ruby_on_rails.md')
-rw-r--r--guides/source/upgrading_ruby_on_rails.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md
index 03be99e8f0..1e752b449d 100644
--- a/guides/source/upgrading_ruby_on_rails.md
+++ b/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