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
c9aee48c
Commit
c9aee48c
authored
Jul 25, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add resolved methods on Discussion
parent
46cc034e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
app/models/discussion.rb
app/models/discussion.rb
+19
-1
No files found.
app/models/discussion.rb
View file @
c9aee48c
class
Discussion
NUMBER_OF_TRUNCATED_DIFF_LINES
=
16
attr_reader
:first_note
,
:notes
attr_reader
:first_note
,
:
last_note
,
:
notes
delegate
:created_at
,
:project
,
...
...
@@ -18,6 +18,11 @@ class Discussion
to: :first_note
delegate
:resolved_at
,
:resolved_by
,
to: :last_note
delegate
:blob
,
:highlighted_diff_lines
,
to: :diff_file
,
allow_nil:
true
def
self
.
for_notes
(
notes
)
...
...
@@ -30,6 +35,7 @@ class Discussion
def
initialize
(
notes
)
@first_note
=
notes
.
first
@last_note
=
notes
.
last
@notes
=
notes
end
...
...
@@ -45,6 +51,18 @@ class Discussion
notes
.
any?
(
&
:legacy_diff_note?
)
end
def
resolvable?
diff_discussion?
&&
notes
.
any?
(
&
:resolvable?
)
end
def
resolved?
notes
.
none?
(
&
:to_be_resolved?
)
end
def
to_be_resolved?
notes
.
any?
(
&
:to_be_resolved?
)
end
def
for_target?
(
target
)
self
.
noteable
==
target
&&
!
diff_discussion?
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