Permalink
Browse files

Documented ActiveResource#observing

  • Loading branch information...
1 parent 2472428 commit 825dae1f0b32bac0e5afde61578534d1a3df8b7b @smartinez87 smartinez87 committed May 1, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 activeresource/lib/active_resource/observing.rb
@@ -5,6 +5,14 @@ module Observing
included do
%w( create save update destroy ).each do |method|
+ # def create_with_notifications(*args, &block)
+ # notify_observers(:before_create)
+ # if result = create_without_notifications(*args, &block)
+ # notify_observers(:after_create)
+ # end
+ # result
+ # end
+ # alias_method_chain(create, :notifications)
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
def #{method}_with_notifications(*args, &block)
notify_observers(:before_#{method})

0 comments on commit 825dae1

Please sign in to comment.