From 825dae1f0b32bac0e5afde61578534d1a3df8b7b Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Sun, 1 May 2011 15:50:53 -0300 Subject: Documented ActiveResource#observing --- activeresource/lib/active_resource/observing.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activeresource/lib') 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}) -- cgit v1.2.3