Class: Crm::ContactsFinder

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Allowable, Gitlab::Utils::StrongMemoize
Defined in:
app/finders/crm/contacts_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(current_user, params = {}) ⇒ ContactsFinder

Returns a new instance of ContactsFinder.


16
17
18
19
# File 'app/finders/crm/contacts_finder.rb', line 16

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

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.


14
15
16
# File 'app/finders/crm/contacts_finder.rb', line 14

def current_user
  @current_user
end

#paramsObject (readonly)

Returns the value of attribute params.


14
15
16
# File 'app/finders/crm/contacts_finder.rb', line 14

def params
  @params
end

Instance Method Details

#executeObject


21
22
23
24
25
# File 'app/finders/crm/contacts_finder.rb', line 21

def execute
  return CustomerRelations::Contact.none unless root_group

  root_group.contacts
end