Skip to content

Commit

Permalink
minor comments cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj Singh committed May 27, 2013
1 parent 952f0fa commit 04f00c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions activerecord/lib/active_record/inheritance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ module Inheritance
extend ActiveSupport::Concern

included do
# Determine whether to store the full constant name including namespace when using STI
# Determines whether to store the full constant name including namespace when using STI.
class_attribute :store_full_sti_class, instance_writer: false
self.store_full_sti_class = true
end

module ClassMethods
# Determines if one of the attributes passed in is the inheritance column,
# and if the inheritance column is attr accessible, it initializes an
# instance of the given subclass instead of the base class
# instance of the given subclass instead of the base class.
def new(*args, &block)
if abstract_class? || self == Base
raise NotImplementedError, "#{self} is an abstract class and can not be instantiated."
Expand All @@ -27,7 +27,8 @@ def new(*args, &block)
super
end

# True if this isn't a concrete subclass needing a STI type condition.
# Returns +true+ if this does not need STI type condition. Returns
# +false+ if STI type condition needs to be applied.
def descends_from_active_record?
if self == Base
false
Expand Down

0 comments on commit 04f00c6

Please sign in to comment.