diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-17 15:52:32 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-17 15:52:32 -0300 |
commit | c33b5e841b54357c1589942dc70192ab0b51fc1e (patch) | |
tree | cf25b9db97e8a06eed8a4b32d451fae0704ee1bc /actionpack | |
parent | fd56b51f9bd9a472a464f7fb5ba40560156cd557 (diff) | |
parent | 6aa115e41f43b179d4c74526aa250d01e823d48d (diff) | |
download | rails-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')
-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 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) |