Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails Single Table Inheritance loading child classes

#3034

I am using Rails 2.1 & Ruby 1.8.7. I have an issue where querying an association proxy or the parent class of that association does not include the types of the child classes in the query. The cause appears to be that Rails internal loading engine does not properly load child models of models using Single Table Inheritance.

I resolved this temporarily by explicitly loading all of the classes in the env.rb file. So now when I call app.breadcrumbs it generates a select statement with a where clause: "WHERE type='Breadcrumb' OR type='Mark' OR type='Measure'".

I would be happy to dig through the Rails internals and provide a patch if someone can at least point me where to dig. I also looked for similar bugs but found none.

If this bug has already been resolved I apologize for the erroneous ticket.

I have attached a sample file that demonstrates my structure.

Reported by tim_linquist · August 11th, 2009 @ 03:31 AM

State: new
Milestone: none
Assigned to: nobody
Importance: none