From eef176dc7d2d7cd5788d6b4ab37d39f0884ae334 Mon Sep 17 00:00:00 2001 From: Robert Ross Date: Tue, 4 Oct 2011 09:37:54 -0700 Subject: Fix as_json doc to say what it actually returns. --- activemodel/lib/active_model/serializers/json.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb index 885964633f..31a3f1e148 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -15,7 +15,7 @@ module ActiveModel self.include_root_in_json = true end - # Returns a JSON string representing the model. Some configuration can be + # Returns a hash representing the model. Some configuration can be # passed through +options+. # # The option include_root_in_json controls the top-level behavior -- cgit v1.2.3 From ac49fb1aa92ac9f65e009eec2bb22f730f8c37f5 Mon Sep 17 00:00:00 2001 From: Robert Ross Date: Tue, 4 Oct 2011 23:42:37 -0700 Subject: Change one more place for JSON string to Hash --- activemodel/lib/active_model/serializers/json.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb index 31a3f1e148..c845440120 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -42,7 +42,7 @@ module ActiveModel # The remainder of the examples in this section assume include_root_in_json is set to # false. # - # Without any +options+, the returned JSON string will include all the model's + # Without any +options+, the returned Hash will include all the model's # attributes. For example: # # user = User.find(1) -- cgit v1.2.3 From a44bbfc1c7edb044ed9f73c7365a3a4a30b8b3fc Mon Sep 17 00:00:00 2001 From: Hendy Tanata Date: Wed, 5 Oct 2011 17:35:58 +0800 Subject: Corrections to Active Record Validations and Callbacks guide. --- railties/guides/source/active_record_validations_callbacks.textile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 6c6f29be32..600681ddd3 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -105,7 +105,7 @@ Person.create(:name => "John Doe").valid? # => true Person.create(:name => nil).valid? # => false -After Active Record performing validations, any errors found can be accessed through the +errors+ instance method, which returns a collection of errors. By definition an object is valid if this collection is empty after running validations. +After Active Record has performed validations, any errors found can be accessed through the +errors+ instance method, which returns a collection of errors. By definition, an object is valid if this collection is empty after running validations. Note that an object instantiated with +new+ will not report errors even if it's technically invalid, because validations are not run when using +new+. @@ -812,7 +812,7 @@ Add this line in your Gemfile: gem "dynamic_form" -Now you will have access to the two help methods +error_messages+ and +error_messages_for+ in your view templates. +Now you will have access to the two helper methods +error_messages+ and +error_messages_for+ in your view templates. h4. +error_messages+ and +error_messages_for+ @@ -907,7 +907,7 @@ ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| end -The result look like the following: +The result looks like the following: !images/validation_error_messages.png(Validation error messages)! -- cgit v1.2.3