diff options
author | Sebastian Martinez <sebastian@wyeworks.com> | 2011-05-01 15:50:53 -0300 |
---|---|---|
committer | Sebastian Martinez <sebastian@wyeworks.com> | 2011-05-01 15:50:53 -0300 |
commit | 825dae1f0b32bac0e5afde61578534d1a3df8b7b (patch) | |
tree | aa059730abe04e0e6aef36d7698cb3131b5d0fc1 | |
parent | 24724288812c8c8892536d0519c019d8a3aea8d1 (diff) | |
download | rails-825dae1f0b32bac0e5afde61578534d1a3df8b7b.tar.gz rails-825dae1f0b32bac0e5afde61578534d1a3df8b7b.tar.bz2 rails-825dae1f0b32bac0e5afde61578534d1a3df8b7b.zip |
Documented ActiveResource#observing
-rw-r--r-- | activeresource/lib/active_resource/observing.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activeresource/lib/active_resource/observing.rb b/activeresource/lib/active_resource/observing.rb index 3c74d49c80..1bfceb8dc8 100644 --- a/activeresource/lib/active_resource/observing.rb +++ b/activeresource/lib/active_resource/observing.rb @@ -5,6 +5,14 @@ module ActiveResource 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}) |