Class: GroupProjectsFinder

Inherits:
ProjectsFinder show all
Defined in:
app/finders/group_projects_finder.rb

Overview

GroupProjectsFinder

Used to filter Projects by set of params

Arguments:

current_user - which user use
project_ids_relation: int[] - project ids to use
group
options:
  only_owned: boolean
  only_shared: boolean
  limit: integer
params:
  sort: string
  visibility_level: int
  tags: string[]
  personal: boolean
  search: string
  non_archived: boolean
  with_issues_enabled: boolean
  with_merge_requests_enabled: boolean
  min_access_level: int

Constant Summary collapse

DEFAULT_PROJECTS_LIMIT =
100

Instance Attribute Summary collapse

Attributes inherited from ProjectsFinder

#current_user, #params, #project_ids_relation

Instance Method Summary collapse

Methods included from CustomAttributesFilter

#by_custom_attributes

Methods inherited from UnionFinder

#find_union

Constructor Details

#initialize(group:, params: {}, options: {}, current_user: nil, project_ids_relation: nil) ⇒ GroupProjectsFinder

Returns a new instance of GroupProjectsFinder.


31
32
33
34
35
36
37
38
39
# File 'app/finders/group_projects_finder.rb', line 31

def initialize(group:, params: {}, options: {}, current_user: nil, project_ids_relation: nil)
  super(
    params: params,
    current_user: current_user,
    project_ids_relation: project_ids_relation
  )
  @group = group
  @options = options
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group


29
30
31
# File 'app/finders/group_projects_finder.rb', line 29

def group
  @group
end

#optionsObject (readonly)

Returns the value of attribute options


29
30
31
# File 'app/finders/group_projects_finder.rb', line 29

def options
  @options
end

Instance Method Details

#executeObject


41
42
43
44
# File 'app/finders/group_projects_finder.rb', line 41

def execute
  collection = super
  limit(collection)
end