Documented ActiveResource#observing

This commit is contained in:
Sebastian Martinez
2011-05-01 15:50:53 -03:00
parent 2472428881
commit 825dae1f0b

View File

@@ -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})