-
Couldn't load subscription status.
- Fork 344
Description
Consider the following structure:
class Section < ActiveRecord::Base
belongs_to :sectionable, polymorphic: true
end
class MarketSection < Section
end
class MarketNotesSection < MarketSection
end
When doing a query for sectionables that have has_many :market_sections, as: :sectionable , on the first run after the environment is loaded, it correctly performs sections.type IN ('MarketSection', 'MarketNotesSection'), because i added an initializer to preload the classes in development, as suggested in http://www.alexreisner.com/code/single-table-inheritance-in-rails for example.
However, as soon as i edit and save a bit of code (a controller for example), the environment "forgets" about the subclass of marketsection and stops including it in the query.
I'd be happy to provide more details if needed.