aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-07-07 12:58:46 +0200
committerXavier Noria <fxn@hashref.com>2010-07-07 12:58:46 +0200
commit64c75d6618b6bc21576e95ceb31467d1984ecb33 (patch)
tree5060a400487473e0abe9baecb9fe7bfa16355083 /activerecord/lib/active_record
parent8735d15e61797d0e6879efbde4f1ca18b4403eff (diff)
parent0f96cea322294f84df34c43000443b249a880126 (diff)
downloadrails-64c75d6618b6bc21576e95ceb31467d1984ecb33.tar.gz
rails-64c75d6618b6bc21576e95ceb31467d1984ecb33.tar.bz2
rails-64c75d6618b6bc21576e95ceb31467d1984ecb33.zip
Merge remote branch 'docrails/master'
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations.rb4
-rw-r--r--activerecord/lib/active_record/base.rb6
2 files changed, 8 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index eebbd17f43..65daa8ffbe 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 <tt>:dependent => :destroy</tt>,
@@ -1193,6 +1195,8 @@ module ActiveRecord
# [collection<<(object, ...)]
# Adds one or more objects to the collection by creating associations in the join table
# (<tt>collection.push</tt> and <tt>collection.concat</tt> 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.
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index c868ff3ae8..3f1015dd4b 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 <tt>abstract_class?</tt>).
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