Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use attribute readers as they are faster in general.

  • Loading branch information...
commit 8f2b2781b0f543d5e56bf997bca7331ed74d29b3 1 parent 6b52a58
@josevalim josevalim authored
Showing with 2 additions and 8 deletions.
  1. +2 −8 actionpack/lib/action_controller/metal/responder.rb
View
10 actionpack/lib/action_controller/metal/responder.rb
@@ -89,6 +89,8 @@ class Responder
def initialize(controller, resources, options={})
@controller = controller
+ @request = @controller.request
+ @format = @controller.formats.first
@resource = resources.last
@resources = resources
@options = options
@@ -99,14 +101,6 @@ def initialize(controller, resources, options={})
delegate :head, :render, :redirect_to, :to => :controller
delegate :get?, :post?, :put?, :delete?, :to => :request
- def request
- @request ||= @controller.request
- end
-
- def format
- @format ||= @controller.formats.first
- end
-
# Undefine :to_json and :to_yaml since it's defined on Object
undef_method(:to_json) if method_defined?(:to_json)
undef_method(:to_yaml) if method_defined?(:to_yaml)
Please sign in to comment.
Something went wrong with that request. Please try again.