From d10aaefcfd4141144eaf971c0560da5631e3dff5 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Thu, 1 Jul 2010 23:06:58 -0400 Subject: clarifying the comments regarding base_class declaration --- activerecord/lib/active_record/base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index c8795e4496..9860c3c725 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -869,6 +869,9 @@ module ActiveRecord #:nodoc: # Returns the base AR subclass that this class descends from. If A # extends AR::Base, A.base_class will return A. If B descends from A # through some arbitrarily deep hierarchy, B.base_class will return A. + # + # If B < A and C < B and if A is an abstract_class then both B.base_class + # and C.base_class would return B as the answer since A is an abstract_class. def base_class class_of_active_record_descendant(self) end @@ -876,8 +879,7 @@ module ActiveRecord #:nodoc: # Set this to true if this is an abstract class (see abstract_class?). attr_accessor :abstract_class - # Returns whether this class is a base AR class. If A is a base class and - # B descends from A, then B.base_class will return B. + # Returns whether this class is an abstract class or not. def abstract_class? defined?(@abstract_class) && @abstract_class == true end -- cgit v1.2.3 From c1fc59c7ac1726f54d54b2896004997892e15ec9 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 6 Jul 2010 10:09:54 -0400 Subject: added more info about << operation in associations --- activerecord/lib/active_record/associations.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 4caa434fc0..49da8595b2 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -763,6 +763,8 @@ module ActiveRecord # An empty array is returned if none are found. # [collection<<(object, ...)] # Adds one or more objects to the collection by setting their foreign keys to the collection's primary key. + # Note that this operation instantly fires update sql without waiting for the save or update call on the + # parent object. # [collection.delete(object, ...)] # Removes one or more objects from the collection by setting their foreign keys to +NULL+. # Objects will be in addition destroyed if they're associated with :dependent => :destroy, @@ -1186,6 +1188,8 @@ module ActiveRecord # [collection<<(object, ...)] # Adds one or more objects to the collection by creating associations in the join table # (collection.push and collection.concat are aliases to this method). + # Note that this operation instantly fires update sql without waiting for the save or update call on the + # parent object. # [collection.delete(object, ...)] # Removes one or more objects from the collection by removing their associations from the join table. # This does not destroy the objects. -- cgit v1.2.3