Commit 3ccdb2b7 authored by Nick Thomas's avatar Nick Thomas

Fix conflicts in MergeRequest model by moving to EE-only module

parent 593112b7
module EE
module MergeRequest
extend ActiveSupport::Concern
include ::Approvable
included do
has_many :approvals, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
has_many :approvers, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
has_many :approver_groups, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
end
def ff_merge_possible?
project.repository.is_ancestor?(target_branch_sha, diff_head_sha)
end
......
......@@ -15,12 +15,6 @@ class MergeRequest < ActiveRecord::Base
belongs_to :source_project, class_name: "Project"
belongs_to :merge_user, class_name: "User"
<<<<<<< HEAD
has_many :approvals, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
has_many :approvers, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
has_many :approver_groups, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
=======
>>>>>>> ce/master
has_many :merge_request_diffs
has_one :merge_request_diff,
-> { order('merge_request_diffs.id DESC') }
......
......@@ -5,6 +5,12 @@ describe MergeRequest, models: true do
subject(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
describe 'associations' do
it { is_expected.to have_many(:approvals).dependent(:delete_all) }
it { is_expected.to have_many(:approvers).dependent(:delete_all) }
it { is_expected.to have_many(:approver_groups).dependent(:delete_all) }
end
describe '#should_be_rebased?' do
subject { merge_request.should_be_rebased? }
......
......@@ -11,10 +11,6 @@ describe MergeRequest, models: true do
it { is_expected.to belong_to(:merge_user).class_name("User") }
it { is_expected.to belong_to(:assignee) }
it { is_expected.to have_many(:merge_request_diffs) }
<<<<<<< HEAD
it { is_expected.to have_many(:approver_groups).dependent(:delete_all) }
=======
>>>>>>> ce/master
end
describe 'modules' do
......
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