Refs #13772 - ensure ApplicationRecord is loaded soon enough
In `lib/core_extensions.rb` we define as `per_page` method, that gets called by `will_paginate` at load time of the models. The issue is we are using `Setting` model there, that inherits from the `ApplicationRecord` but the `ApplicationRecord` is not loaded yet at that time, which leads to Rails not knowings it's abstract class and therefore expecting it to be a base for STI.
After this patch, we require the `ApplicationRecord` soon enough to make sure it's present before using any other model.
Related issues
Bug #13772: The orchestration code uses SQL logger
Refs #13772 - ensure ApplicationRecord is loaded soon enough
In `lib/core_extensions.rb` we define as `per_page` method, that gets
called by `will_paginate` at load time of the models. The issue is
we are using `Setting` model there, that inherits from the
`ApplicationRecord` but the `ApplicationRecord` is not loaded yet at
that time, which leads to Rails not knowings it's abstract class
and therefore expecting it to be a base for STI.
After this patch, we require the `ApplicationRecord` soon enough to make
sure it's present before using any other model.