aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-15 14:45:18 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-15 15:57:33 +0100
commite5a2a9fced3e5559ac139977922a0f63a53c6c5c (patch)
treea0de1faec1f5e12e6f7ea2fd7e70bdecacde9a2d /activeresource/lib
parent4598d8874948268e1162c1ef75d0bd565b1e0e64 (diff)
downloadrails-e5a2a9fced3e5559ac139977922a0f63a53c6c5c.tar.gz
rails-e5a2a9fced3e5559ac139977922a0f63a53c6c5c.tar.bz2
rails-e5a2a9fced3e5559ac139977922a0f63a53c6c5c.zip
Remove URI object from ActiveResource notification, send the :mailer class in AM (like in AP#process_action) and remove locale instrumentation.
Diffstat (limited to 'activeresource/lib')
-rw-r--r--activeresource/lib/active_resource/connection.rb7
-rw-r--r--activeresource/lib/active_resource/railties/subscriber.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb
index d06543d700..2f0ccd7dae 100644
--- a/activeresource/lib/active_resource/connection.rb
+++ b/activeresource/lib/active_resource/connection.rb
@@ -106,9 +106,10 @@ module ActiveResource
private
# Makes a request to the remote service.
def request(method, path, *arguments)
- result = ActiveSupport::Notifications.instrument("active_resource.request",
- :method => method, :path => path, :site => site) do |payload|
- payload[:result] = http.send(method, path, *arguments)
+ result = ActiveSupport::Notifications.instrument("active_resource.request") do |payload|
+ payload[:method] = method
+ payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
+ payload[:result] = http.send(method, path, *arguments)
end
handle_response(result)
rescue Timeout::Error => e
diff --git a/activeresource/lib/active_resource/railties/subscriber.rb b/activeresource/lib/active_resource/railties/subscriber.rb
index 42c108d702..fb98061b71 100644
--- a/activeresource/lib/active_resource/railties/subscriber.rb
+++ b/activeresource/lib/active_resource/railties/subscriber.rb
@@ -2,8 +2,8 @@ module ActiveResource
module Railties
class Subscriber < Rails::Subscriber
def request(event)
- result, site = event.payload[:result], event.payload[:site]
- info "#{event.payload[:method].to_s.upcase} #{site.scheme}://#{site.host}:#{site.port}#{event.payload[:path]}"
+ result = event.payload[:result]
+ info "#{event.payload[:method].to_s.upcase} #{event.payload[:request_uri]}"
info "--> %d %s %d (%.1fms)" % [result.code, result.message, result.body.to_s.length, event.duration]
end