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