Project

General

Profile

« Previous | Next » 

Revision 2e7dfc3d

Added by Ivan Necas about 7 years ago

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.

  • added
  • modified
  • copied
  • renamed
  • deleted