aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorRobb Kidd <robb@thekidds.org>2012-06-09 16:04:01 -0300
committerRobb Kidd <robb@thekidds.org>2012-06-09 16:04:01 -0300
commitf20208842ab1f5f6f44b08bda5beb35985c5dd5e (patch)
tree8d203aa9a31b6204351c9ce18f07979bd114f11f /activemodel
parentb1f634a3797003ab6276ee47fe187dd56e52c3fd (diff)
downloadrails-f20208842ab1f5f6f44b08bda5beb35985c5dd5e.tar.gz
rails-f20208842ab1f5f6f44b08bda5beb35985c5dd5e.tar.bz2
rails-f20208842ab1f5f6f44b08bda5beb35985c5dd5e.zip
Make observer enable/disable documentation more informative.
* Moved the simplest case--enable/disable all on all--to the top. * Made clear what "ORM" means to avoid having to teach people how to solve "uninitialized constant ORM" errors in their test reports.
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/observer_array.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/observer_array.rb b/activemodel/lib/active_model/observer_array.rb
index 3d463885be..8de6918d18 100644
--- a/activemodel/lib/active_model/observer_array.rb
+++ b/activemodel/lib/active_model/observer_array.rb
@@ -17,6 +17,11 @@ module ActiveModel
# Disables one or more observers. This supports multiple forms:
#
+ # ORM.observers.disable :all
+ # # => disables all observers for all models subclassed from
+ # # an ORM base class that includes ActiveModel::Observing
+ # # e.g. ActiveRecord::Base
+ #
# ORM.observers.disable :user_observer
# # => disables the UserObserver
#
@@ -27,9 +32,6 @@ module ActiveModel
# ORM.observers.disable :observer_1, :observer_2
# # => disables Observer1 and Observer2 for all models.
#
- # ORM.observers.disable :all
- # # => disables all observers for all models.
- #
# User.observers.disable :all do
# # all user observers are disabled for
# # just the duration of the block
@@ -40,6 +42,11 @@ module ActiveModel
# Enables one or more observers. This supports multiple forms:
#
+ # ORM.observers.enable :all
+ # # => enables all observers for all models subclassed from
+ # # an ORM base class that includes ActiveModel::Observing
+ # # e.g. ActiveRecord::Base
+ #
# ORM.observers.enable :user_observer
# # => enables the UserObserver
#
@@ -51,9 +58,6 @@ module ActiveModel
# ORM.observers.enable :observer_1, :observer_2
# # => enables Observer1 and Observer2 for all models.
#
- # ORM.observers.enable :all
- # # => enables all observers for all models.
- #
# User.observers.enable :all do
# # all user observers are enabled for
# # just the duration of the block