diff options
author | Xavier Noria <fxn@hashref.com> | 2011-05-01 11:16:31 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-05-01 11:16:31 +0200 |
commit | 2fbf302149cf40c791ca1207a5f984cf58903397 (patch) | |
tree | 5da770d0fd31520a6264a9864b1db1412646d100 /activemodel/lib/active_model/observing.rb | |
parent | a0656989c47c29c87c4f243ce3695c39777c67b8 (diff) | |
parent | b84b759ec60b5005fea183186639408fcf903450 (diff) | |
download | rails-2fbf302149cf40c791ca1207a5f984cf58903397.tar.gz rails-2fbf302149cf40c791ca1207a5f984cf58903397.tar.bz2 rails-2fbf302149cf40c791ca1207a5f984cf58903397.zip |
Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
railties/guides/source/contributing_to_ruby_on_rails.textile
Diffstat (limited to 'activemodel/lib/active_model/observing.rb')
-rw-r--r-- | activemodel/lib/active_model/observing.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index c1ac4eb4af..cfe71074a5 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -56,6 +56,8 @@ module ActiveModel end # Add a new observer to the pool. + # The new observer needs to respond to 'update', otherwise it + # raises an +ArgumentError+ exception. def add_observer(observer) unless observer.respond_to? :update raise ArgumentError, "observer needs to respond to `update'" @@ -144,8 +146,8 @@ module ActiveModel # Observers will by default be mapped to the class with which they share a # name. So CommentObserver will be tied to observing Comment, ProductManagerObserver # to ProductManager, and so on. If you want to name your observer differently than - # the class you're interested in observing, you can use the Observer.observe class - # method which takes either the concrete class (Product) or a symbol for that + # the class you're interested in observing, you can use the <tt>Observer.observe</tt> + # class method which takes either the concrete class (Product) or a symbol for that # class (:product): # # class AuditObserver < ActiveModel::Observer |