aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2012-04-30 14:20:42 -0400
committerMarc-Andre Lafortune <github@marc-andre.ca>2012-04-30 22:13:26 -0400
commitdc74f0cb1bdbb07accc9412644ff4d30803218a7 (patch)
treebf98f86f655d73134f90f7601bacd0ea548b641d /activemodel/lib/active_model
parent206b43a954dc6c6c0b4b3916cade2561413efdb5 (diff)
downloadrails-dc74f0cb1bdbb07accc9412644ff4d30803218a7.tar.gz
rails-dc74f0cb1bdbb07accc9412644ff4d30803218a7.tar.bz2
rails-dc74f0cb1bdbb07accc9412644ff4d30803218a7.zip
notify_observers should be public
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/observing.rb37
1 files changed, 18 insertions, 19 deletions
diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb
index 4c7dae42f0..f5ea285ccb 100644
--- a/activemodel/lib/active_model/observing.rb
+++ b/activemodel/lib/active_model/observing.rb
@@ -110,25 +110,24 @@ module ActiveModel
end
end
- private
- # Fires notifications to model's observers
- #
- # def save
- # notify_observers(:before_save)
- # ...
- # notify_observers(:after_save)
- # end
- #
- # Custom notifications can be sent in a similar fashion:
- #
- # notify_observers(:custom_notification, :foo)
- #
- # This will call +custom_notification+, passing as arguments
- # the current object and :foo.
- #
- def notify_observers(method, *extra_args)
- self.class.notify_observers(method, self, *extra_args)
- end
+ # Fires notifications to model's observers
+ #
+ # def save
+ # notify_observers(:before_save)
+ # ...
+ # notify_observers(:after_save)
+ # end
+ #
+ # Custom notifications can be sent in a similar fashion:
+ #
+ # notify_observers(:custom_notification, :foo)
+ #
+ # This will call +custom_notification+, passing as arguments
+ # the current object and :foo.
+ #
+ def notify_observers(method, *extra_args)
+ self.class.notify_observers(method, self, *extra_args)
+ end
end
# == Active Model Observers