mirror of
https://github.com/github/rails.git
synced 2026-01-09 14:48:01 -05:00
Documented ActiveResource#observing
This commit is contained in:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user