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
15842c74
Commit
15842c74
authored
Nov 21, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fill timestamp for Approver bulk insertion
parent
096ddf92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
ee/app/services/ee/merge_requests/refresh_service.rb
ee/app/services/ee/merge_requests/refresh_service.rb
+5
-1
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
+5
-1
No files found.
ee/app/services/ee/merge_requests/refresh_service.rb
View file @
15842c74
...
...
@@ -60,11 +60,15 @@ module EE
return
if
users
.
empty?
return
unless
merge_request
.
approvers_overwritten?
now
=
Time
.
now
rows
=
users
.
map
do
|
user
|
{
target_id:
merge_request
.
id
,
target_type:
merge_request
.
class
.
name
,
user_id:
user
.
id
user_id:
user
.
id
,
created_at:
now
,
updated_at:
now
}
end
...
...
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
View file @
15842c74
...
...
@@ -119,8 +119,12 @@ describe MergeRequests::RefreshService do
it
'creates Approver'
do
expect
{
subject
}.
to
change
{
Approver
.
count
}.
by
(
1
)
new_approver
=
merge_request
.
approvers
.
last
expect
(
merge_request
.
approvers
.
first
.
user
).
to
eq
(
existing_approver
)
expect
(
merge_request
.
approvers
.
last
.
user
).
to
eq
(
owner
)
expect
(
new_approver
.
user
).
to
eq
(
owner
)
expect
(
new_approver
.
created_at
).
to
be_present
expect
(
new_approver
.
updated_at
).
to
be_present
end
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