Module: Kithe::StiPreload

Extended by:
ActiveSupport::Concern
Included in:
Model
Defined in:
lib/kithe/sti_preload.rb

Overview

From: guides.rubyonrails.org/v6.0/autoloading_and_reloading_constants.html#single-table-inheritance

https://edgeguides.rubyonrails.org/autoloading_and_reloading_constants.html#single-table-inheritance

While this is recommended starting with Rails6 and zeitwerk, it will work fine under Rails 5.2 and previous also, to make sure all sub-classes in db are loaded, so ActiveRecord knows how to create SQL WHERE clauses on particular inheritance hieararchies.

We include in our Kithe::Model, which uses Single-Table Inheritance

BUT NOTE: What’s in Rails Guide right now actually breaks in Rails 7.

We’ve messed with based on github.com/rails/rails/issues/45307 et al.