From 9edd4e18c411e6834569bbe7b6350f02342970d8 Mon Sep 17 00:00:00 2001 From: AvnerCohen Date: Tue, 23 Oct 2012 22:39:49 +0200 Subject: Migration of docs to 1.9 hash syntax --- activerecord/lib/active_record/associations/preloader.rb | 6 +++--- activerecord/lib/active_record/associations/through_association.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index c1cd3a4ae3..0848e7afb3 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -72,7 +72,7 @@ module ActiveRecord # books. # - a Hash which specifies multiple association names, as well as # association names for the to-be-preloaded association objects. For - # example, specifying { :author => :avatar } will preload a + # example, specifying { author: :avatar } will preload a # book's author, as well as that author's avatar. # # +:associations+ has the same format as the +:include+ option for @@ -80,8 +80,8 @@ module ActiveRecord # # :books # [ :books, :author ] - # { :author => :avatar } - # [ :books, { :author => :avatar } ] + # { author: :avatar } + # [ :books, { author: :avatar } ] def initialize(records, associations, preload_scope = nil) @records = Array.wrap(records).compact.uniq @associations = Array.wrap(associations) diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb index b9e014735b..43520142bf 100644 --- a/activerecord/lib/active_record/associations/through_association.rb +++ b/activerecord/lib/active_record/associations/through_association.rb @@ -28,7 +28,7 @@ module ActiveRecord # methods which create and delete records on the association. # # We only support indirectly modifying through associations which has a belongs_to source. - # This is the "has_many :tags, :through => :taggings" situation, where the join model + # This is the "has_many :tags, through: :taggings" situation, where the join model # typically has a belongs_to on both side. In other words, associations which could also # be represented as has_and_belongs_to_many associations. # -- cgit v1.2.3 From 211accced6ccd457f54650bc3b7cf184f8ca0bba Mon Sep 17 00:00:00 2001 From: Andrii Dovgaliuk Date: Wed, 24 Oct 2012 09:47:19 -0400 Subject: fix a typo in comments to ActiveRecord::Associations::Association.stale_state --- activerecord/lib/active_record/associations/association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index ba75c8be41..2a5f727728 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -223,7 +223,7 @@ module ActiveRecord end # This should be implemented to return the values of the relevant key(s) on the owner, - # so that when state_state is different from the value stored on the last find_target, + # so that when stale_state is different from the value stored on the last find_target, # the target is stale. # # This is only relevant to certain associations, which is why it returns nil by default. -- cgit v1.2.3 From 2c4faaaedd36fd7c55bef516c71d3dd5f46a6164 Mon Sep 17 00:00:00 2001 From: kennyj Date: Fri, 2 Nov 2012 01:34:29 +0900 Subject: This is comment for singular association. --- activerecord/lib/active_record/associations/singular_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index 32f4557c28..10238555f0 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -12,7 +12,7 @@ module ActiveRecord target end - # Implements the writer method, e.g. foo.items= for Foo.has_many :items + # Implements the writer method, e.g. foo.bar= for Foo.belongs_to :bar def writer(record) replace(record) end -- cgit v1.2.3