Class: Projects::GroupGroupLinksFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/projects/group_group_links_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(project, params = {}) ⇒ GroupGroupLinksFinder

Returns a new instance of GroupGroupLinksFinder.

Parameters:

  • project (Project)

    project to find memberships for

  • params (Hash) (defaults to: {})

    optional parameters

Options Hash (params):

  • :max_access (Boolean)

    when true, returns only highest access level memberships

  • :search (String)

    filter by group namespace



10
11
12
13
# File 'app/finders/projects/group_group_links_finder.rb', line 10

def initialize(project, params = {})
  @project = project
  @params = params
end

Instance Method Details

#executeActiveRecord::Relation

Executes the finder and returns group links.

Returns:

  • (ActiveRecord::Relation)

    collection of GroupGroupLink records



18
19
20
21
22
# File 'app/finders/projects/group_group_links_finder.rb', line 18

def execute
  return GroupGroupLink.none unless project.group

  by_search(collection)
end