From 9c3cb751f0ebf06d3ee15ae9c6279e49af9ee0e6 Mon Sep 17 00:00:00 2001 From: Nick Pellant Date: Mon, 7 Jul 2014 13:24:26 +0100 Subject: [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. --- guides/source/upgrading_ruby_on_rails.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides/source/upgrading_ruby_on_rails.md') 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 -- cgit v1.2.3