Commit fc5393ff authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'app-models-2' into 'master'

Move prepend to last line in app models - 2

See merge request gitlab-org/gitlab!31827
parents 4d98851a 94e68c42
# frozen_string_literal: true # frozen_string_literal: true
# Group Milestones are milestones that can be shared among many projects within the same group # Group Milestones are milestones that can be shared among many projects within the same group
class GroupMilestone < GlobalMilestone class GroupMilestone < GlobalMilestone
include_if_ee('::EE::GroupMilestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :group, :milestones attr_reader :group, :milestones
def self.build_collection(group, projects, params) def self.build_collection(group, projects, params)
...@@ -46,3 +45,5 @@ class GroupMilestone < GlobalMilestone ...@@ -46,3 +45,5 @@ class GroupMilestone < GlobalMilestone
true true
end end
end end
GroupMilestone.include_if_ee('::EE::GroupMilestone')
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
class List < ApplicationRecord class List < ApplicationRecord
include Importable include Importable
prepend_if_ee('::EE::List') # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :board belongs_to :board
belongs_to :label belongs_to :label
has_many :list_user_preferences has_many :list_user_preferences
...@@ -104,3 +102,5 @@ class List < ApplicationRecord ...@@ -104,3 +102,5 @@ class List < ApplicationRecord
throw(:abort) unless destroyable? # rubocop:disable Cop/BanCatchThrow throw(:abort) unless destroyable? # rubocop:disable Cop/BanCatchThrow
end end
end end
List.prepend_if_ee('::EE::List')
# frozen_string_literal: true # frozen_string_literal: true
class MembersPreloader class MembersPreloader
prepend_if_ee('EE::MembersPreloader') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :members attr_reader :members
def initialize(members) def initialize(members)
...@@ -16,3 +14,5 @@ class MembersPreloader ...@@ -16,3 +14,5 @@ class MembersPreloader
ActiveRecord::Associations::Preloader.new.preload(members.map(&:user), :u2f_registrations) ActiveRecord::Associations::Preloader.new.preload(members.map(&:user), :u2f_registrations)
end end
end end
MembersPreloader.prepend_if_ee('EE::MembersPreloader')
---
title: Move prepend to last line in app models 2
merge_request: 31827
author: Rajendra Kadam
type: fixed
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