Class: API::Entities::ProjectWithAccess
- Inherits:
-
Project
- Object
- Grape::Entity
- ProjectIdentity
- BasicProjectDetails
- Project
- API::Entities::ProjectWithAccess
- Defined in:
- lib/api/entities/project_with_access.rb
Class Method Summary collapse
- .postload_relation(projects_relation, options = {}) ⇒ Object
-
.preload_relation(projects_relation, options = {}) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord.
Methods inherited from Project
execute_batch_counting, preload_resource, repositories_for_preload
Methods included from Helpers::RelatedResourcesHelpers
#expose_path, #expose_url, #issues_available?, #mrs_available?, #project_feature_string_access_level
Methods inherited from BasicProjectDetails
Class Method Details
.postload_relation(projects_relation, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/api/entities/project_with_access.rb', line 31 def self.postload_relation(projects_relation, = {}) [:project_members] = [:current_user] .project_members .where(source_id: projects_relation.subquery(:id)) .preload(:source, user: [notification_settings: :source]) [:group_members] = [:current_user] .group_members .where(source_id: projects_relation.subquery(:namespace_id)) .preload(:source, user: [notification_settings: :source]) end |
.preload_relation(projects_relation, options = {}) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord
27 28 29 |
# File 'lib/api/entities/project_with_access.rb', line 27 def self.preload_relation(projects_relation, = {}) super(projects_relation, ) end |