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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
7b75f3cf
Commit
7b75f3cf
authored
Mar 15, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show who merged request
parent
828f84fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
app/models/merge_request.rb
app/models/merge_request.rb
+4
-0
app/models/project.rb
app/models/project.rb
+2
-1
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+10
-0
No files found.
app/models/merge_request.rb
View file @
7b75f3cf
...
...
@@ -68,6 +68,10 @@ class MergeRequest < ActiveRecord::Base
commits
.
first
end
def
merge_event
self
.
project
.
events
.
where
(
:target_id
=>
self
.
id
,
:target_type
=>
"MergeRequest"
,
:action
=>
Event
::
Merged
).
last
end
# Return the number of +1 comments (upvotes)
def
upvotes
notes
.
select
(
&
:
upvote?
).
size
...
...
app/models/project.rb
View file @
7b75f3cf
...
...
@@ -99,7 +99,8 @@ class Project < ActiveRecord::Base
Event
.
create
(
:project
=>
self
,
:action
=>
Event
::
Merged
,
:data
=>
{
:merge_request_id
=>
merge_request
.
id
},
:target_id
=>
merge_request
.
id
,
:target_type
=>
"MergeRequest"
,
:author_id
=>
user
.
id
)
end
...
...
app/views/merge_requests/show.html.haml
View file @
7b75f3cf
...
...
@@ -28,6 +28,16 @@
%hr
-
if
@merge_request
.
closed
.alert-message.error
Closed
-
if
@merge_request
.
merged
-
event
=
@merge_request
.
merge_event
%div
%p
%strong
#{
event
.
author_name
}
merged this request
%span
.cgray
=
time_ago_in_words
(
event
.
created_at
)
ago.
%br
-
else
.alert-message.success
=
link_to
"#"
,
:class
=>
"info_link"
,
:title
=>
"How To Merge"
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