diff options
author | Zachary Scott <e@zzak.io> | 2014-10-18 13:04:02 -0700 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2014-10-18 13:04:02 -0700 |
commit | 7b71d8cfabe71dc9cf265809eed51e6956b60b7f (patch) | |
tree | a501183c27ec86acd5155f50f0afd0ee5ceb371a /actionpack/lib/action_controller/metal | |
parent | faf3616d5eecd68ef5feff504d2d18b5c533d785 (diff) | |
download | rails-7b71d8cfabe71dc9cf265809eed51e6956b60b7f.tar.gz rails-7b71d8cfabe71dc9cf265809eed51e6956b60b7f.tar.bz2 rails-7b71d8cfabe71dc9cf265809eed51e6956b60b7f.zip |
Revert "Replace (slower) block.call with (faster) yield"
This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/mime_responds.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index 591f881a53..dc572f13d2 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -216,11 +216,11 @@ module ActionController #:nodoc: # # Be sure to check the documentation of +respond_with+ and # <tt>ActionController::MimeResponds.respond_to</tt> for more examples. - def respond_to(*mimes) + def respond_to(*mimes, &block) raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given? collector = Collector.new(mimes, request.variant) - yield collector if block_given? + block.call(collector) if block_given? if format = collector.negotiate_format(request) _process_format(format) |