diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-22 20:17:27 +0100 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-22 11:29:06 -0800 |
commit | 4964d3b02cd5c87d821ab7d41d243154c727185d (patch) | |
tree | e3818132241dd91d62ac1483219df16f973cf679 /actionpack/lib/abstract_controller | |
parent | 8e48a5ef0ca488b2264acd2b38bdae14970c011f (diff) | |
download | rails-4964d3b02cd5c87d821ab7d41d243154c727185d.tar.gz rails-4964d3b02cd5c87d821ab7d41d243154c727185d.tar.bz2 rails-4964d3b02cd5c87d821ab7d41d243154c727185d.zip |
Make ActionMailer::Base inherit from AbstractController::Base
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/base.rb | 8 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/logger.rb | 28 |
2 files changed, 4 insertions, 32 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index 9d57c52429..efea81aa71 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -84,7 +84,7 @@ module AbstractController # # ==== Returns # self - def process(action) + def process(action, *args) @_action_name = action_name = action.to_s unless action_name = method_for_action(action_name) @@ -93,7 +93,7 @@ module AbstractController @_response_body = nil - process_action(action_name) + process_action(action_name, *args) end private @@ -113,8 +113,8 @@ module AbstractController # Call the action. Override this in a subclass to modify the # behavior around processing an action. This, and not #process, # is the intended way to override action dispatching. - def process_action(method_name) - send_action(method_name) + def process_action(method_name, *args) + send_action(method_name, *args) end # Actually call the method associated with the action. Override diff --git a/actionpack/lib/abstract_controller/logger.rb b/actionpack/lib/abstract_controller/logger.rb index 27ba5be45f..e3bcd28da7 100644 --- a/actionpack/lib/abstract_controller/logger.rb +++ b/actionpack/lib/abstract_controller/logger.rb @@ -29,33 +29,5 @@ module AbstractController @str.send(*args, &block) end end - - # Override process_action in the AbstractController::Base - # to log details about the method. - def process_action(action) - result = ActiveSupport::Notifications.instrument(:process_action, - :controller => self, :action => action) do - super - end - - if logger - log = DelayedLog.new do - "\n\nProcessing #{self.class.name}\##{action_name} " \ - "to #{request.formats} (for #{request_origin}) " \ - "[#{request.method.to_s.upcase}]" - end - - logger.info(log) - end - - result - end - - private - # Returns the request origin with the IP and time. This needs to be cached, - # otherwise we would get different results for each time it calls. - def request_origin - @request_origin ||= "#{request.remote_ip} at #{Time.now.to_s(:db)}" - end end end |