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
1d1ef632
Commit
1d1ef632
authored
Feb 13, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
f45cf85f
17b10338
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
app/models/discussion.rb
app/models/discussion.rb
+0
-2
app/models/individual_note_discussion.rb
app/models/individual_note_discussion.rb
+6
-2
app/services/notes/create_service.rb
app/services/notes/create_service.rb
+1
-1
spec/services/notes/create_service_spec.rb
spec/services/notes/create_service_spec.rb
+8
-1
No files found.
app/models/discussion.rb
View file @
1d1ef632
...
...
@@ -17,8 +17,6 @@ class Discussion
:for_commit?
,
:for_merge_request?
,
:save
,
to: :first_note
def
project_id
...
...
app/models/individual_note_discussion.rb
View file @
1d1ef632
...
...
@@ -17,8 +17,12 @@ class IndividualNoteDiscussion < Discussion
noteable
.
supports_replying_to_individual_notes?
&&
Feature
.
enabled?
(
:reply_to_individual_notes
)
end
def
convert_to_discussion!
first_note
.
becomes!
(
Discussion
.
note_class
).
to_discussion
def
convert_to_discussion!
(
save:
false
)
first_note
.
becomes!
(
Discussion
.
note_class
).
to_discussion
.
tap
do
# Save needs to be called on first_note instead of the transformed note
# because of https://gitlab.com/gitlab-org/gitlab-ce/issues/57324
first_note
.
save
if
save
end
end
def
reply_attributes
...
...
app/services/notes/create_service.rb
View file @
1d1ef632
...
...
@@ -35,7 +35,7 @@ module Notes
if
!
only_commands
&&
note
.
save
if
note
.
part_of_discussion?
&&
note
.
discussion
.
can_convert_to_discussion?
note
.
discussion
.
convert_to_discussion!
.
save
(
touch:
fals
e
)
note
.
discussion
.
convert_to_discussion!
(
save:
tru
e
)
end
todo_service
.
new_note
(
note
,
current_user
)
...
...
spec/services/notes/create_service_spec.rb
View file @
1d1ef632
...
...
@@ -311,7 +311,14 @@ describe Notes::CreateService do
end
it
'converts existing note to DiscussionNote'
do
expect
{
subject
}.
to
change
{
existing_note
.
reload
.
type
}.
from
(
nil
).
to
(
'DiscussionNote'
)
expect
do
existing_note
Timecop
.
freeze
(
Time
.
now
+
1
.
minute
)
{
subject
}
existing_note
.
reload
end
.
to
change
{
existing_note
.
type
}.
from
(
nil
).
to
(
'DiscussionNote'
)
.
and
change
{
existing_note
.
updated_at
}
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