Skip to content
Browse files

clarifying the comments regarding base_class declaration

  • Loading branch information...
1 parent a6913bf commit d10aaefcfd4141144eaf971c0560da5631e3dff5 Neeraj Singh committed Jul 1, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/lib/active_record/base.rb
6 activerecord/lib/active_record/base.rb
@@ -869,15 +869,17 @@ def ===(object)
# 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
# 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

0 comments on commit d10aaef

Please sign in to comment.
Something went wrong with that request. Please try again.