Commit 5b1aa9f4 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Various fixes when loading classes

This prepares us for switching to the Zeitwerk autoloader
parent b01c63af
......@@ -1588,6 +1588,7 @@ Gitlab/NamespacedClass:
- 'app/models/list_user_preference.rb'
- 'app/models/member.rb'
- 'app/models/members/group_member.rb'
- 'app/models/members/last_group_owner_assigner.rb'
- 'app/models/members/project_member.rb'
- 'app/models/members_preloader.rb'
- 'app/models/merge_request.rb'
......
# frozen_string_literal: true
module Members
class LastGroupOwnerAssigner
class LastGroupOwnerAssigner
def initialize(group, members)
@group = group
@members = members
......@@ -42,5 +41,4 @@ module Members
def owners
@owners ||= group.members_with_parents.owners.load
end
end
end
......@@ -4,7 +4,7 @@ class MemberSerializer < BaseSerializer
entity MemberEntity
def represent(members, opts = {})
Members::LastGroupOwnerAssigner.new(opts[:group], members).execute unless opts[:source].is_a?(Project)
LastGroupOwnerAssigner.new(opts[:group], members).execute unless opts[:source].is_a?(Project)
super(members, opts)
end
......
......@@ -28,7 +28,7 @@ module API
desc 'Update existing merge request approval setting' do
detail 'This feature is gated by the :group_merge_request_approval_settings_feature_flag'
success EE::API::Entities::GroupMergeRequestApprovalSetting
success ::API::Entities::GroupMergeRequestApprovalSetting
end
params do
optional :allow_author_approval, type: Boolean, desc: 'Allow authors to self-approve merge requests'
......
......@@ -3,7 +3,7 @@
module Gitlab
module SubscriptionPortal
class Client
include SubscriptionPortal::Clients::REST
include SubscriptionPortal::Clients::Rest
include SubscriptionPortal::Clients::Graphql
ResponseError = Class.new(StandardError)
......
......@@ -3,7 +3,7 @@
module Gitlab
module SubscriptionPortal
module Clients
module REST
module Rest
extend ActiveSupport::Concern
class_methods do
......
......@@ -6,5 +6,5 @@ RSpec.describe Gitlab::SubscriptionPortal::Client do
subject { described_class }
it { is_expected.to include_module Gitlab::SubscriptionPortal::Clients::Graphql }
it { is_expected.to include_module Gitlab::SubscriptionPortal::Clients::REST }
it { is_expected.to include_module Gitlab::SubscriptionPortal::Clients::Rest }
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::SubscriptionPortal::Clients::REST do
RSpec.describe Gitlab::SubscriptionPortal::Clients::Rest do
let(:client) { Gitlab::SubscriptionPortal::Client }
let(:http_response) { nil }
let(:http_method) { :post }
......
......@@ -23,7 +23,7 @@ module API
expose :issue_type,
as: :type,
format_with: :upcase,
documentation: { type: "String", desc: "One of #{Issue.issue_types.keys.map(&:upcase)}" }
documentation: { type: "String", desc: "One of #{::Issue.issue_types.keys.map(&:upcase)}" }
expose :assignee, using: ::API::Entities::UserBasic do |issue|
issue.assignees.first
......
......@@ -5,7 +5,7 @@ module Gitlab
module MigrationHelpers
include Migrations::BackgroundMigrationHelpers
include DynamicModelHelpers
include Migrations::RenameTableHelpers
include RenameTableHelpers
# https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
MAX_IDENTIFIER_NAME_LENGTH = 63
......
# frozen_string_literal: true
# rubocop:disable Cop/CustomErrorClass
module Gitlab
module Graphql
StandardGraphqlError = Class.new(StandardError)
class StandardGraphqlError < StandardError
end
end
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Members::LastGroupOwnerAssigner do
RSpec.describe LastGroupOwnerAssigner do
describe "#execute" do
let_it_be(:user, reload: true) { create(:user) }
let_it_be(:group) { create(:group) }
......
......@@ -42,7 +42,7 @@ RSpec.describe MemberSerializer do
it_behaves_like 'members.json'
it 'does not invoke group owner assignment' do
expect(Members::LastGroupOwnerAssigner).not_to receive(:new)
expect(LastGroupOwnerAssigner).not_to receive(:new)
representation
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment