Commit db9a8965 authored by Giorgenes Gelatti's avatar Giorgenes Gelatti Committed by Heinrich Lee Yu

Move preload of ip_restrictions in project to EE

parent 09773394
...@@ -522,11 +522,6 @@ class Project < ApplicationRecord ...@@ -522,11 +522,6 @@ class Project < ApplicationRecord
.where(project_pages_metadata: { project_id: nil }) .where(project_pages_metadata: { project_id: nil })
end end
scope :with_api_entity_associations, -> {
preload(:project_feature, :route, :tags,
group: [:ip_restrictions, :saml_provider], namespace: [:route, :owner])
}
scope :with_api_commit_entity_associations, -> { scope :with_api_commit_entity_associations, -> {
preload(:project_feature, :route, namespace: [:route, :owner]) preload(:project_feature, :route, namespace: [:route, :owner])
} }
...@@ -545,6 +540,10 @@ class Project < ApplicationRecord ...@@ -545,6 +540,10 @@ class Project < ApplicationRecord
# Used by Projects::CleanupService to hold a map of rewritten object IDs # Used by Projects::CleanupService to hold a map of rewritten object IDs
mount_uploader :bfg_object_map, AttachmentUploader mount_uploader :bfg_object_map, AttachmentUploader
def self.with_api_entity_associations
preload(:project_feature, :route, :tags, :group, namespace: [:route, :owner])
end
def self.with_web_entity_associations def self.with_web_entity_associations
preload(:project_feature, :route, :creator, :group, namespace: [:route, :owner]) preload(:project_feature, :route, :creator, :group, namespace: [:route, :owner])
end end
......
...@@ -204,6 +204,11 @@ module EE ...@@ -204,6 +204,11 @@ module EE
def with_web_entity_associations def with_web_entity_associations
super.preload(:compliance_framework_setting) super.preload(:compliance_framework_setting)
end end
override :with_api_entity_associations
def with_api_entity_associations
super.preload(group: [:ip_restrictions, :saml_provider])
end
end end
def has_regulated_settings? def has_regulated_settings?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment