Skip to content
Snippets Groups Projects
Commit 47b30384 authored by gfyoung's avatar gfyoung
Browse files

Enable frozen string in app/graphql + app/finders

Partially addresses #47424.
parent e91dc8f4
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Showing
with 40 additions and 0 deletions
# frozen_string_literal: true
class AccessRequestsFinder
attr_accessor :source
 
Loading
Loading
# frozen_string_literal: true
class Admin::ProjectsFinder
attr_reader :params, :current_user
 
Loading
Loading
# frozen_string_literal: true
class BranchesFinder
def initialize(repository, params = {})
@repository = repository
Loading
Loading
# frozen_string_literal: true
class ClustersFinder
def initialize(project, user, scope)
@project = project
Loading
Loading
# frozen_string_literal: true
module CreatedAtFilter
def by_created_at(items)
items = items.created_before(params[:created_before]) if params[:created_before].present?
Loading
Loading
# frozen_string_literal: true
module CustomAttributesFilter
def by_custom_attributes(items)
return items unless params[:custom_attributes].is_a?(Hash)
Loading
Loading
# frozen_string_literal: true
module FinderMethods
def find_by!(*args)
raise_not_found_unless_authorized execute.find_by!(*args)
Loading
Loading
# frozen_string_literal: true
# Module to prepend into finders to specify wether or not the finder requires
# cross project access
#
Loading
Loading
# frozen_string_literal: true
class ContributedProjectsFinder < UnionFinder
def initialize(user)
@user = user
Loading
Loading
# frozen_string_literal: true
class EnvironmentsFinder
attr_reader :project, :current_user, :params
 
Loading
Loading
# frozen_string_literal: true
class EventsFinder
prepend FinderMethods
prepend FinderWithCrossProjectAccess
Loading
Loading
# frozen_string_literal: true
class ForkProjectsFinder < ProjectsFinder
def initialize(project, params: {}, current_user: nil)
project_ids = project.forks.includes(:creator).select(:id)
Loading
Loading
# frozen_string_literal: true
# GroupDescendantsFinder
#
# Used to find and filter all subgroups and projects of a passed parent group
Loading
Loading
# frozen_string_literal: true
class GroupFinder
include Gitlab::Allowable
 
Loading
Loading
# frozen_string_literal: true
class GroupMembersFinder
def initialize(group)
@group = group
Loading
Loading
# frozen_string_literal: true
# GroupProjectsFinder
#
# Used to filter Projects by set of params
Loading
Loading
# frozen_string_literal: true
# GroupsFinder
#
# Used to filter Groups by a set of params
Loading
Loading
# frozen_string_literal: true
# IssuableFinder
#
# Used to filter Issues and MergeRequests collections by set of params
Loading
Loading
# frozen_string_literal: true
# Finders::Issues class
#
# Used to filter Issues collections by set of params
Loading
Loading
# frozen_string_literal: true
class JoinedGroupsFinder < UnionFinder
def initialize(user)
@user = user
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment