# Toplevel constant Parent referenced by Parent::Parent

**URL:** <https://www.ruby-forum.com/t/toplevel-constant-parent-referenced-by-parent-parent/129573>\
**Category:** Rails\
**Created:** [February 19, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/toplevel-constant-parent-referenced-by-parent-parent/129573 "2008-02-19T19:58:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamdirkcalloway](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/eb8c5e/32.png) [@iamdirkcalloway](https://www.ruby-forum.com/u/iamdirkcalloway)\
**Post date:** [February 19, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/toplevel-constant-parent-referenced-by-parent-parent/129573/1 "2008-02-19T19:58:13Z")

</div>

I’m upgrading from 1.1.6 to 1.2.6 and I’m getting a strange warning.

`
activerecord/lib/active_record/base.rb:1361: warning: toplevel constant
Parent referenced by Parent::Parent
`

Where Parent is the top-level class in an STI hierarchy.

I also have:  
class Child1 \< Parent  
class Child2 \< Child1

In Parent I have several class convenience methods:

`
  class <<self
```
def new_parent(class_name, args={})
  send("new_#{class_name}", args)
end

def new_child1(args={})
  Child1.new(args.merge(:child1_specific_configurations => args))
end

def new_child2(args={})
  Child2.new(args.merge(:child2_specific_configurations => args))
end

```
end
`

Should I be worried about the warning? I’m not sure that I understand it  
and I don’t see it with my other STI classes. The above methods aren’t  
expressly required, they just make working the class hierarchy easier.

Thanks in advance.

Erik
