aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/observing.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-09-08 15:38:51 -0300
committerEmilio Tagua <miloops@gmail.com>2009-09-08 15:38:51 -0300
commit670281c6b2e9b9e8c51a140f2a5f66b251f1b84b (patch)
treeab141872d72e010c8a0fe371d22a00914c97e1eb /activemodel/lib/active_model/observing.rb
parent39e4e76d15233bb1cb0b778d920f54efe86bb4f0 (diff)
parent1a0f822037c408a392ffa7b6e1ecbe5951ab48db (diff)
downloadrails-670281c6b2e9b9e8c51a140f2a5f66b251f1b84b.tar.gz
rails-670281c6b2e9b9e8c51a140f2a5f66b251f1b84b.tar.bz2
rails-670281c6b2e9b9e8c51a140f2a5f66b251f1b84b.zip
Merge commit 'rails/master'
Conflicts: activerecord/lib/active_record/associations.rb
Diffstat (limited to 'activemodel/lib/active_model/observing.rb')
-rw-r--r--activemodel/lib/active_model/observing.rb17
1 files changed, 0 insertions, 17 deletions
diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb
index 3b230c43b9..d9d1ab8967 100644
--- a/activemodel/lib/active_model/observing.rb
+++ b/activemodel/lib/active_model/observing.rb
@@ -40,23 +40,6 @@ module ActiveModel
observers.each { |o| instantiate_observer(o) }
end
- # Wraps methods with before and after notifications.
- #
- # wrap_with_notifications :create, :save, :update, :destroy
- def wrap_with_notifications(*methods)
- methods.each do |method|
- class_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{method}_with_notifications(*args, &block)
- notify_observers(:before_#{method})
- result = #{method}_without_notifications(*args, &block)
- notify_observers(:after_#{method})
- result
- end
- EOS
- alias_method_chain(method, :notifications)
- end
- end
-
protected
def instantiate_observer(observer) #:nodoc:
# string/symbol