aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/observing.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-04-21 23:04:04 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-04-21 23:04:04 +0530
commita719843d31042690fa4fa8f55bc8a647d360b2a8 (patch)
treed7cf910019968511bd33a15ba2c3709a366f23cd /activemodel/lib/active_model/observing.rb
parented8108300b2bb96f9f6888188f4fb8cd418ab950 (diff)
parentc670b57f0f9ec4d992f89e62e513ff5b7baf58ac (diff)
downloadrails-a719843d31042690fa4fa8f55bc8a647d360b2a8.tar.gz
rails-a719843d31042690fa4fa8f55bc8a647d360b2a8.tar.bz2
rails-a719843d31042690fa4fa8f55bc8a647d360b2a8.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activemodel/lib/active_model/observing.rb')
-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)