mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Clarify STI models loading process with a comment.
This commit is contained in:
@@ -28,16 +28,21 @@
|
||||
# See COPYRIGHT and LICENSE files for more details.
|
||||
#++
|
||||
|
||||
# Here we are loading STI models explicitly using rails autoloader.
|
||||
# It is relevant for environments where lazy loading is enabled (usually, development and testing).
|
||||
# If an STI model has not been loaded it can lead to undesired behavior like:
|
||||
# Fetching not loaded yet STI model (ServiceAccount) through its parent model(User)
|
||||
# (e.g. User.find(service_account_id) raises ActiveRecord::NotFound.
|
||||
Rails.application.config.to_prepare do
|
||||
# Load Enumeration descendants due to STI
|
||||
# Load Enumeration descendants
|
||||
IssuePriority
|
||||
|
||||
# Load Principal descendants due to STI
|
||||
# Load Principal descendants
|
||||
User
|
||||
PlaceholderUser
|
||||
Group
|
||||
|
||||
# Use User descendants due to STI
|
||||
# Load User descendants
|
||||
SystemUser
|
||||
AnonymousUser
|
||||
Users::InexistentUser
|
||||
|
||||
Reference in New Issue
Block a user