Class: Preloaders::Environments::DeploymentPreloader
- Inherits:
-
Object
- Object
- Preloaders::Environments::DeploymentPreloader
- Defined in:
- app/models/preloaders/environments/deployment_preloader.rb
Overview
This class is to batch-load deployments of multiple environments. The deployments to batch-load are fetched using UNION of N selects in a single query instead of default scoping with ‘IN (environment_id1, environment_id2 …)`. See gitlab.com/gitlab-org/gitlab/-/issues/345672#note_761852224 for more details.
Instance Attribute Summary collapse
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
Instance Method Summary collapse
- #execute_with_union(association_name, association_attributes) ⇒ Object
-
#initialize(environments) ⇒ DeploymentPreloader
constructor
A new instance of DeploymentPreloader.
Constructor Details
#initialize(environments) ⇒ DeploymentPreloader
Returns a new instance of DeploymentPreloader.
11 12 13 |
# File 'app/models/preloaders/environments/deployment_preloader.rb', line 11 def initialize(environments) @environments = environments end |
Instance Attribute Details
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
9 10 11 |
# File 'app/models/preloaders/environments/deployment_preloader.rb', line 9 def environments @environments end |
Instance Method Details
#execute_with_union(association_name, association_attributes) ⇒ Object
15 16 17 |
# File 'app/models/preloaders/environments/deployment_preloader.rb', line 15 def execute_with_union(association_name, association_attributes) load_deployment_association(association_name, association_attributes) end |