STI with multiple models is 'lazy loaded' #407

lunks opened this Issue May 5, 2011 · 2 comments


None yet

3 participants


Having 3 models using STI:

class Low < Medium; end

class Medium < High; end

class High < ActiveRecord::Base; end

If I run Medium.all, the SQL ActiveRecord outputs looks for records on the highs table with type='Medium', and as such doesn't find any records for 'Low' objects.

Afterwards, If I try High.all and then Medium.all, then it successfully looks for records with type='Medium' or type='Low'.

Ruby on Rails member

This is documented. Nothing we can do here, you need to require all models.

@josevalim josevalim closed this May 6, 2011

@josevalim where is this documented? I can't seem to find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment