aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/mime_responds.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-17 15:52:32 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-17 15:52:32 -0300
commitc33b5e841b54357c1589942dc70192ab0b51fc1e (patch)
treecf25b9db97e8a06eed8a4b32d451fae0704ee1bc /actionpack/lib/action_controller/metal/mime_responds.rb
parentfd56b51f9bd9a472a464f7fb5ba40560156cd557 (diff)
parent6aa115e41f43b179d4c74526aa250d01e823d48d (diff)
downloadrails-c33b5e841b54357c1589942dc70192ab0b51fc1e.tar.gz
rails-c33b5e841b54357c1589942dc70192ab0b51fc1e.tar.bz2
rails-c33b5e841b54357c1589942dc70192ab0b51fc1e.zip
Merge pull request #17302 from claudiob/replace-slower-block-call-with-faster-yield
Replace (slower) block.call with (faster) yield
Diffstat (limited to 'actionpack/lib/action_controller/metal/mime_responds.rb')
-rw-r--r--actionpack/lib/action_controller/metal/mime_responds.rb4
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 dc572f13d2..591f881a53 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, &block)
+ def respond_to(*mimes)
raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given?
collector = Collector.new(mimes, request.variant)
- block.call(collector) if block_given?
+ yield collector if block_given?
if format = collector.negotiate_format(request)
_process_format(format)