Class: API::Entities::ProjectWithAccess

Inherits:
Project show all
Defined in:
lib/api/entities/project_with_access.rb

Class Method Summary collapse

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

execute_batch_counting

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, options = {})
  options[:project_members] = options[:current_user]
    .project_members
    .where(source_id: projects_relation.subquery(:id))
    .preload(:source, user: [notification_settings: :source])

  options[:group_members] = options[: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, options = {})
  super(projects_relation, options)
end