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
99ad6088
Commit
99ad6088
authored
Jun 29, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Approval model to FOSS
parent
96106357
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
11 deletions
+19
-11
app/models/approval.rb
app/models/approval.rb
+0
-0
app/models/merge_request.rb
app/models/merge_request.rb
+3
-0
ee/app/models/ee/merge_request.rb
ee/app/models/ee/merge_request.rb
+0
-2
ee/spec/models/approval_spec.rb
ee/spec/models/approval_spec.rb
+0
-9
spec/factories/approvals.rb
spec/factories/approvals.rb
+0
-0
spec/models/approval_spec.rb
spec/models/approval_spec.rb
+16
-0
No files found.
ee/
app/models/approval.rb
→
app/models/approval.rb
View file @
99ad6088
File moved
app/models/merge_request.rb
View file @
99ad6088
...
...
@@ -90,6 +90,9 @@ class MergeRequest < ApplicationRecord
has_many
:draft_notes
has_many
:reviews
,
inverse_of: :merge_request
has_many
:approvals
,
dependent: :delete_all
# rubocop:disable Cop/ActiveRecordDependent
has_many
:approved_by_users
,
through: :approvals
,
source: :user
KNOWN_MERGE_PARAMS
=
[
:auto_merge_strategy
,
:should_remove_source_branch
,
...
...
ee/app/models/ee/merge_request.rb
View file @
99ad6088
...
...
@@ -15,8 +15,6 @@ module EE
include
DeprecatedApprovalsBeforeMerge
include
UsageStatistics
has_many
:approvals
,
dependent: :delete_all
# rubocop:disable Cop/ActiveRecordDependent
has_many
:approved_by_users
,
through: :approvals
,
source: :user
has_many
:approvers
,
as: :target
,
dependent: :delete_all
# rubocop:disable Cop/ActiveRecordDependent
has_many
:approver_users
,
through: :approvers
,
source: :user
has_many
:approver_groups
,
as: :target
,
dependent: :delete_all
# rubocop:disable Cop/ActiveRecordDependent
...
...
ee/spec/models/approval_spec.rb
deleted
100644 → 0
View file @
96106357
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Approval
do
subject
{
create
(
:approval
)
}
it
{
is_expected
.
to
be_valid
}
end
ee/
spec/factories/approvals.rb
→
spec/factories/approvals.rb
View file @
99ad6088
File moved
spec/models/approval_spec.rb
0 → 100644
View file @
99ad6088
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Approval
do
context
'presence validation'
do
it
{
is_expected
.
to
validate_presence_of
(
:merge_request_id
)
}
it
{
is_expected
.
to
validate_presence_of
(
:user_id
)
}
end
context
'uniqueness validation'
do
let!
(
:existing_record
)
{
create
(
:approval
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:user_id
).
scoped_to
([
:merge_request_id
])
}
end
end
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