Reputation: 72514
I want to have these models:
AbstractArticle
Article < AbstractArticle
FeaturedArticle < AbstractArticle
I want the name of the database table to be articles
and not abstract_articles
. (As the convention suggests)
Is this possible with Rails? How can I tell my base model to use a different table? Will STI still work even though the table name does not follow the convention?
Upvotes: 1
Views: 184
Reputation: 8512
Yes, you can.
class AbstractArticle < ActiveRecord::Base
set_table_name :articles
end
Upvotes: 3