Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3ccdb2b7
Commit
3ccdb2b7
authored
Jul 06, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts in MergeRequest model by moving to EE-only module
parent
593112b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
app/models/ee/merge_request.rb
app/models/ee/merge_request.rb
+8
-0
app/models/merge_request.rb
app/models/merge_request.rb
+0
-6
spec/models/ee/merge_request_spec.rb
spec/models/ee/merge_request_spec.rb
+6
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-4
No files found.
app/models/ee/merge_request.rb
View file @
3ccdb2b7
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
...
...
app/models/merge_request.rb
View file @
3ccdb2b7
...
...
@@ -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'
)
}
...
...
spec/models/ee/merge_request_spec.rb
View file @
3ccdb2b7
...
...
@@ -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?
}
...
...
spec/models/merge_request_spec.rb
View file @
3ccdb2b7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment