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