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 | |
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')
-rw-r--r-- | activemodel/lib/active_model/dirty.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/naming.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/observing.rb | 6 | ||||
-rw-r--r-- | activemodel/lib/active_model/translation.rb | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb index 5ede78617a..3b412d3dd7 100644 --- a/activemodel/lib/active_model/dirty.rb +++ b/activemodel/lib/active_model/dirty.rb @@ -93,7 +93,7 @@ module ActiveModel attribute_method_affix :prefix => 'reset_', :suffix => '!' end - # Do any attributes have unsaved changes? + # Returns true if any attribute have unsaved changes, false otherwise. # person.changed? # => false # person.name = 'bob' # person.changed? # => true diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index 315ccd40e9..74708692af 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -68,7 +68,7 @@ module ActiveModel # BookModule::BookCover.model_name.i18n_key # => "book_module.book_cover" # # Providing the functionality that ActiveModel::Naming provides in your object - # is required to pass the Active Model Lint test. So either extending the provided + # is required to pass the Active Model Lint test. So either extending the provided # method below, or rolling your own is required. module Naming # Returns an ActiveModel::Name object for module. It can be 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 diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb index 920a133159..6d64c81b5f 100644 --- a/activemodel/lib/active_model/translation.rb +++ b/activemodel/lib/active_model/translation.rb @@ -18,12 +18,12 @@ module ActiveModel # # This also provides the required class methods for hooking into the # Rails internationalization API, including being able to define a - # class based i18n_scope and lookup_ancestors to find translations in + # class based +i18n_scope+ and +lookup_ancestors+ to find translations in # parent classes. module Translation include ActiveModel::Naming - # Returns the i18n_scope for the class. Overwrite if you want custom lookup. + # Returns the +i18n_scope+ for the class. Overwrite if you want custom lookup. def i18n_scope :activemodel end |