diff options
Diffstat (limited to 'activemodel/lib/active_model')
-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 |