diff options
author | José Valim and Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-21 11:42:22 +1100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-21 11:42:22 +1100 |
commit | fbdbac2b88218e5e3e6087c67dacf7e755aa4106 (patch) | |
tree | 6fdec21b56ab90fc2ec83cbc38033439a9c84e74 /actionpack/lib/action_dispatch/middleware/notifications.rb | |
parent | d3da87ce771845f99bbdc04d6d6587b22655b063 (diff) | |
parent | fa9f000246c2f6010f18bf40237d105b782873e2 (diff) | |
download | rails-fbdbac2b88218e5e3e6087c67dacf7e755aa4106.tar.gz rails-fbdbac2b88218e5e3e6087c67dacf7e755aa4106.tar.bz2 rails-fbdbac2b88218e5e3e6087c67dacf7e755aa4106.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/notifications.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/notifications.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/notifications.rb b/actionpack/lib/action_dispatch/middleware/notifications.rb index c3776d53a8..ce3732b740 100644 --- a/actionpack/lib/action_dispatch/middleware/notifications.rb +++ b/actionpack/lib/action_dispatch/middleware/notifications.rb @@ -9,7 +9,9 @@ module ActionDispatch end def call(env) - payload = retrieve_payload_from_env(env) + request = Request.new(env) + payload = retrieve_payload_from_env(request.filter_env) + ActiveSupport::Notifications.instrument("action_dispatch.before_dispatch", payload) ActiveSupport::Notifications.instrument!("action_dispatch.after_dispatch", payload) do @@ -21,11 +23,10 @@ module ActionDispatch raise exception end - protected - - # Remove any rack related constants from the env, like rack.input. - def retrieve_payload_from_env(env) - Hash[:env => env.except(*env.keys.select { |k| k.to_s.index("rack.") == 0 })] - end + protected + # Remove any rack related constants from the env, like rack.input. + def retrieve_payload_from_env(env) + Hash[:env => env.except(*env.keys.select { |k| k.to_s.index("rack.") == 0 })] + end end -end
\ No newline at end of file +end |