diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-15 11:01:37 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-15 12:24:31 +0100 |
commit | 7f4d8e3fbd704cf1005a46309e3795192b114013 (patch) | |
tree | 39b65d628b46cc849086470c614b66351141cd0d /activeresource/lib/active_resource | |
parent | b0994be5bd24559f1362a636b46271de6d6a92d6 (diff) | |
download | rails-7f4d8e3fbd704cf1005a46309e3795192b114013.tar.gz rails-7f4d8e3fbd704cf1005a46309e3795192b114013.tar.bz2 rails-7f4d8e3fbd704cf1005a46309e3795192b114013.zip |
Yield the payload notifications for further modification (like adding the result).
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index ee700700ae..d06543d700 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -106,9 +106,9 @@ 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 - http.send(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) end handle_response(result) rescue Timeout::Error => e |