Class: Groups::AcceptingProjectTransfersFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/groups/accepting_project_transfers_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_user) ⇒ AcceptingProjectTransfersFinder

Returns a new instance of AcceptingProjectTransfersFinder.



5
6
7
# File 'app/finders/groups/accepting_project_transfers_finder.rb', line 5

def initialize(current_user)
  @current_user = current_user
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/finders/groups/accepting_project_transfers_finder.rb', line 9

def execute
  groups_accepting_project_transfers =
    [
      current_user.manageable_groups,
      managable_groups_originating_from_group_shares
    ]

  groups = ::Group.from_union(groups_accepting_project_transfers)

  groups.project_creation_allowed
end