2012-04-02 14 views
6

Rails 3の中で最もクールなのは通知です。しかし、私が購読できるすべての通知名のリストがあるかどうか尋ねたいのですが?Rails 3標準通知リスト

私はここで答えを見つけることができない場合、私はコードに行くことができます(わずかな例)、ドキュメントでそれを見つけることができませんでした。

答えて

1

設定/初期化子/ notifications.rb

ActiveSupport::Notifications.subscribe "process_action.action_controller" do |name, start, finish, id, payload| 
     PageRequest.create! do |page_request| 
     page_request.path = payload[:path] 
     page_request.page_duration = (finish - start) * 1000 
     page_request.view_duration = payload[:view_runtime] 
     page_request.db_duration = payload[:db_runtime] 
     end 
    end 

詳細here

+0

しかし、加入したときに文字列または正規表現を使用できるように===演算子は、マッチングのために使用されていることを

注意がほんの少しの例ですが、私が聞きたいのは利用可能な通知の完全なリストを持つことです。 –

+0

@Said、http://stackoverflow.com/questions/146650について何かお知らせください16/rails-activesupport-notifications-wrong-db-runtime-value? – Fivell

4

私はまったく同じものを探していました。これについてはドキュメントがないようですので、コードを参照して次のリストをコンパイルしました。

receive.action_mailer 
deliver.action_mailer 

write_fragment.action_controller 
read_fragment.action_controller 
exist_fragment?.action_controller 
expire_fragment.action_controller 

expire_page.action_controller 
write_page.action_controller 

start_processing.action_controller 
process_action.action_controller 
send_file.action_controller 
send_data.action_controller 
redirect_to.action_controller 
halted_callback.action_controller 

render_collection.action_view 
render_partial.action_view 
render_template.action_view 
!render_template.action_view 

sql.active_record 

cache_read.active_support 
cache_fetch_hit.active_support 
cache_generate.active_support 
cache_write.active_support 
cache_delete.active_support 
cache_exist?.active_support 

deprecation.rails 

render 
+0

ありがとうございました –

関連する問題