Class: Autocomplete::GroupUsersFinder
- Inherits:
- 
      Object
      
        - Object
- Autocomplete::GroupUsersFinder
 
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/finders/autocomplete/group_users_finder.rb
Instance Attribute Summary collapse
- 
  
    
      #current_user  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute current_user. 
- 
  
    
      #group  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute group. 
Instance Method Summary collapse
- #execute ⇒ Object
- 
  
    
      #initialize(group:, current_user:)  ⇒ GroupUsersFinder 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of GroupUsersFinder. 
Constructor Details
#initialize(group:, current_user:) ⇒ GroupUsersFinder
| 17 18 19 20 | # File 'app/finders/autocomplete/group_users_finder.rb', line 17 def initialize(group:, current_user:) @group = group @current_user = current_user end | 
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
| 15 16 17 | # File 'app/finders/autocomplete/group_users_finder.rb', line 15 def current_user @current_user end | 
#group ⇒ Object (readonly)
Returns the value of attribute group.
| 15 16 17 | # File 'app/finders/autocomplete/group_users_finder.rb', line 15 def group @group end | 
Instance Method Details
#execute ⇒ Object
| 22 23 24 25 26 27 28 29 30 31 | # File 'app/finders/autocomplete/group_users_finder.rb', line 22 def execute members = Member .with(group_hierarchy_cte.to_arel) # rubocop:disable CodeReuse/ActiveRecord .with(descendant_projects_cte.to_arel) # rubocop:disable CodeReuse/ActiveRecord .from_union(member_relations, remove_duplicates: false) User .id_in(members.select(:user_id)) .allow_cross_joins_across_databases(url: "https://gitlab.com/gitlab-org/gitlab/-/issues/420387") end |