aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-04-18 15:23:06 +0200
committerOscar Del Ben <info@oscardelben.com>2012-04-18 15:23:06 +0200
commit7536731a9ac5668a81c2581697edf25e1341519e (patch)
treef3ad5147e67e62f350ffa4a44f6d5befa401e978 /activemodel
parent3333fe283c8b15dca9786e95b764a2664f2ceaef (diff)
downloadrails-7536731a9ac5668a81c2581697edf25e1341519e.tar.gz
rails-7536731a9ac5668a81c2581697edf25e1341519e.tar.bz2
rails-7536731a9ac5668a81c2581697edf25e1341519e.zip
Improve observers documentation
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/observing.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb
index 29687866e3..fc84b52dd9 100644
--- a/activemodel/lib/active_model/observing.rb
+++ b/activemodel/lib/active_model/observing.rb
@@ -214,6 +214,7 @@ module ActiveModel
end
# Start observing the declared classes and their subclasses.
+ # Called automatically by the instance method.
def initialize
observed_classes.each { |klass| add_observer!(klass) }
end
@@ -242,6 +243,7 @@ module ActiveModel
klass.add_observer(self)
end
+ # Returns true if notifications are disabled for this object.
def disabled_for?(object)
klass = object.class
return false unless klass.respond_to?(:observers)