I have two tables I am using single table inheritance with: Page and
Item. “Page” has many “Items”; “Item” belongs to “Page”.
class Item < ActiveRecord::Base
class Article < Item
class Page < ActiveRecord::Base
class Issue < Page
In my controller, when I call @page.articles I am getting the following
Mysql::Error: #42S22Unknown column ‘items.issue_id’ in ‘where clause’:
SELECT * FROM items WHERE (items.issue_id = 4) AND ( (items.
‘Article’ ) )
I see exactly where the snafu is ‘items.issue_id’ should be
‘items.PAGE_id’ (caps for emphasis). I assume either I am setting up
the model incorrectly, or I’m trying to do something that’s not
supported. Everything else is exactly how I expect it.
Is there any way out of this hole?