search for: activitylistener

Displaying 1 result from an estimated 1 matches for "activitylistener".

2009 Sep 27
1
Switchboard - Easy to use global ActiveRecord event listeners
...ting with listeners" do before do Switchboard.listeners << FooListener end end When doing data imports, migrations or certain actions that need to only use certain listeners, you can easily specify which ones you''d like to use: Switchboard.with_listeners AuditListener, ActivityListener do Article.create! :title => "foo" end After the block runs, the original listeners are restored. If you want to run some code with no listeners, you can do so with: Switchboard.without_listeners do Article.create! :title => "foo" end To contribute: http://github....