class_of_active_record_descendant (ActiveRecord::Base)

    # File lib/active_record/base.rb, line 1914
            def class_of_active_record_descendant(klass)
              if klass.superclass == Base || klass.superclass.abstract_class?
                klass
              elsif klass.superclass.nil?
                raise ActiveRecordError, "#{name} doesn't belong in a hierarchy descending from ActiveRecord"
              else
                class_of_active_record_descendant(klass.superclass)
              end
            end