Class: Packages::GroupPackagesFinder

Inherits:
Object
  • Object
show all
Includes:
FinderHelper
Defined in:
app/finders/packages/group_packages_finder.rb

Direct Known Subclasses

Composer::PackagesFinder

Constant Summary

Constants included from FinderHelper

FinderHelper::InvalidPackageTypeError, FinderHelper::InvalidStatusError

Instance Method Summary collapse

Constructor Details

#initialize(current_user, group, params = { exclude_subgroups: false, exact_name: false, order_by: 'created_at', sort: 'asc' }) ⇒ GroupPackagesFinder

Returns a new instance of GroupPackagesFinder.


7
8
9
10
11
# File 'app/finders/packages/group_packages_finder.rb', line 7

def initialize(current_user, group, params = { exclude_subgroups: false, exact_name: false, order_by: 'created_at', sort: 'asc' })
  @current_user = current_user
  @group = group
  @params = params
end

Instance Method Details

#executeObject


13
14
15
16
17
# File 'app/finders/packages/group_packages_finder.rb', line 13

def execute
  return ::Packages::Package.none unless group

  packages_for_group_projects
end