From 91148936f770dc8bbbb33d46a09528f1a32d8a71 Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Wed, 22 Feb 2012 22:19:42 +0200 Subject: Minor fixes to ActiveRecord::AutosaveAssociation's docs * Fix typos * Remove meaningless code from the examples --- activerecord/lib/active_record/autosave_association.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index d468663084..ed13bdf68f 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -44,9 +44,6 @@ module ActiveRecord # automatically _and_ atomically: # # post = Post.find(1) - # post.title # => "The current global position of migrating ducks" - # post.author.name # => "alloy" - # # post.title = "On the migration of ducks" # post.author.name = "Eloy Duran" # @@ -78,7 +75,7 @@ module ActiveRecord # When :autosave is not declared new children are saved when their parent is saved: # # class Post - # has_many :comments # :autosave option is no declared + # has_many :comments # :autosave option is not declared # end # # post = Post.new(:title => 'ruby rocks') @@ -93,7 +90,8 @@ module ActiveRecord # post.comments.create(:body => 'hello world') # post.save # => saves both post and comment # - # When :autosave is true all children is saved, no matter whether they are new records: + # When :autosave is true all children are saved, no matter whether they + # are new records or not: # # class Post # has_many :comments, :autosave => true -- cgit v1.2.3 From 7ee7f14e11ad83d7c0800478ee451aabb45b914a Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Wed, 22 Feb 2012 22:25:44 +0200 Subject: Revert "Remove meaningless code from the examples" of AutosaveAssociation Reverts a part of 91148936f770dc8bbbb33d46a09528f1a32d8a71. Should probably be squashed with it when merging back in rails/rails. --- activerecord/lib/active_record/autosave_association.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index ed13bdf68f..4bafadc666 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -44,6 +44,9 @@ module ActiveRecord # automatically _and_ atomically: # # post = Post.find(1) + # post.title # => "The current global position of migrating ducks" + # post.author.name # => "alloy" + # # post.title = "On the migration of ducks" # post.author.name = "Eloy Duran" # -- cgit v1.2.3 From 0519567e3d3ad77e88866e8fb79ff2b24424d724 Mon Sep 17 00:00:00 2001 From: Noah Hendrix Date: Fri, 24 Feb 2012 13:55:24 -0600 Subject: Fixed typo in composed_of example with Money#<=>, was comparing amount itself instead of other_money.amount --- activerecord/lib/active_record/aggregations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 5a8addc4e4..c39284539c 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -46,7 +46,7 @@ module ActiveRecord # # def <=>(other_money) # if currency == other_money.currency - # amount <=> amount + # amount <=> other_money.amount # else # amount <=> other_money.exchange_to(currency).amount # end -- cgit v1.2.3