Commented above, but had limited editing capabilities. I ran into this exact problem and found the other half of the solution elsewhere. STI will let you get a subset of a table based on a column in a table, but it will drop the class name to find records for that class. For instance:
class Company < ActiveRecord::Base; end class Client < Company; end
This will look at a table named Company for records that have a value of βClientβ in a column named βTypeβ.
You can override the column that checks the STI by doing
class Company < ActiveRecord::Base self.inheritance_column = :company_type end
But he is still looking for this column containing "Client". You can override what it is looking for by doing this:
class Client < Company def self.sti_name 1 end end
You will now see the company_type column for rows with a value of 1.
For Rails-4.2, this is almost identical, but does not require a class method:
private self.inheritance_column = :company_type def sti_name 1 end
source share