Class: Organizations::UserOrganizationsFinder

Inherits:
OrganizationsFinder show all
Defined in:
app/finders/organizations/user_organizations_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_user, target_user, params = {}) ⇒ UserOrganizationsFinder

Returns a new instance of UserOrganizationsFinder.



5
6
7
8
9
# File 'app/finders/organizations/user_organizations_finder.rb', line 5

def initialize(current_user, target_user, params = {})
  super(current_user, params)

  @target_user = target_user
end

Instance Method Details

#executeObject



11
12
13
14
15
16
# File 'app/finders/organizations/user_organizations_finder.rb', line 11

def execute
  return Organizations::Organization.none unless can_read_user_organizations?
  return Organizations::Organization.none if target_user.blank?

  super
end