From a2bfa5fa305d7eebfee1bcb2c556112a3e03f2c2 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 26 Apr 2011 23:26:10 -0300 Subject: Better formatting on ActiveModel::Translation --- activemodel/lib/active_model/translation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activemodel') 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 -- cgit v1.2.3 From 4554983ab18ec60a3575f469125c3b0d98df4e33 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 26 Apr 2011 23:29:11 -0300 Subject: Removed extra whitespace --- activemodel/lib/active_model/naming.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel') 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 -- cgit v1.2.3 From c4b494bdc44a7aaa6b38b512d0bf6cfb8f1cfb15 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 26 Apr 2011 23:37:11 -0300 Subject: Rephrased Dirty#changed? docs --- activemodel/lib/active_model/dirty.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel') 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 -- cgit v1.2.3 From b84b759ec60b5005fea183186639408fcf903450 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Sat, 30 Apr 2011 20:35:25 -0300 Subject: Improved ActiveModel Observing docs. --- activemodel/lib/active_model/observing.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'activemodel') 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 Observer.observe + # class method which takes either the concrete class (Product) or a symbol for that # class (:product): # # class AuditObserver < ActiveModel::Observer -- cgit v1.2.3