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
d9a949c1
Commit
d9a949c1
authored
Jul 28, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use correct user for 'Discussion resolved by...'
parent
1bee660b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
app/models/discussion.rb
app/models/discussion.rb
+12
-1
app/models/merge_request.rb
app/models/merge_request.rb
+6
-3
No files found.
app/models/discussion.rb
View file @
d9a949c1
...
@@ -21,7 +21,8 @@ class Discussion
...
@@ -21,7 +21,8 @@ class Discussion
delegate
:resolved_at
,
delegate
:resolved_at
,
:resolved_by
,
:resolved_by
,
to: :last_note
to: :last_resolved_note
,
allow_nil:
true
delegate
:blob
,
:highlighted_diff_lines
,
to: :diff_file
,
allow_nil:
true
delegate
:blob
,
:highlighted_diff_lines
,
to: :diff_file
,
allow_nil:
true
...
@@ -39,6 +40,12 @@ class Discussion
...
@@ -39,6 +40,12 @@ class Discussion
@notes
=
notes
@notes
=
notes
end
end
def
last_resolved_note
return
unless
resolved?
@last_resolved_note
||=
resolved_notes
.
sort_by
(
&
:resolved_at
).
last
end
def
last_updated_at
def
last_updated_at
last_note
.
created_at
last_note
.
created_at
end
end
...
@@ -67,6 +74,10 @@ class Discussion
...
@@ -67,6 +74,10 @@ class Discussion
resolvable?
&&
notes
.
none?
(
&
:to_be_resolved?
)
resolvable?
&&
notes
.
none?
(
&
:to_be_resolved?
)
end
end
def
resolved_notes
notes
.
select
(
&
:resolved?
)
end
def
to_be_resolved?
def
to_be_resolved?
notes
.
any?
(
&
:to_be_resolved?
)
notes
.
any?
(
&
:to_be_resolved?
)
end
end
...
...
app/models/merge_request.rb
View file @
d9a949c1
...
@@ -395,15 +395,18 @@ class MergeRequest < ActiveRecord::Base
...
@@ -395,15 +395,18 @@ class MergeRequest < ActiveRecord::Base
end
end
def
discussions
def
discussions
self
.
mr_and_commit_notes
.
@discussions
||=
self
.
mr_and_commit_notes
.
inc_author_project_award_emoji
.
inc_author_project_award_emoji
.
fresh
.
fresh
.
discussions
discussions
end
end
def
discussions_resolvable?
discussions
.
any?
(
&
:resolvable?
)
end
def
discussions_resolved?
def
discussions_resolved?
all_discussions
=
discussions
discussions_resolvable?
&&
discussions
.
none?
(
&
:to_be_resolved?
)
all_discussions
.
any?
(
&
:resolvable?
)
&&
all_discussions
.
none?
(
&
:to_be_resolved?
)
end
end
def
hook_attrs
def
hook_attrs
...
...
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