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
aefefbf1
Commit
aefefbf1
authored
Nov 13, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevents position update for image diff notes
parent
9200b500
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
app/models/diff_note.rb
app/models/diff_note.rb
+2
-1
changelogs/unreleased/issue_40058.yml
changelogs/unreleased/issue_40058.yml
+5
-0
spec/models/diff_note_spec.rb
spec/models/diff_note_spec.rb
+6
-0
No files found.
app/models/diff_note.rb
View file @
aefefbf1
...
@@ -18,7 +18,8 @@ class DiffNote < Note
...
@@ -18,7 +18,8 @@ class DiffNote < Note
validate
:positions_complete
validate
:positions_complete
validate
:verify_supported
validate
:verify_supported
before_validation
:set_original_position
,
:update_position
,
on: :create
before_validation
:set_original_position
,
on: :create
before_validation
:update_position
,
on: :create
,
if: :on_text?
before_validation
:set_line_code
before_validation
:set_line_code
after_save
:keep_around_commits
after_save
:keep_around_commits
...
...
changelogs/unreleased/issue_40058.yml
0 → 100644
View file @
aefefbf1
---
title
:
Prevents position update for image diff notes
merge_request
:
author
:
type
:
fixed
spec/models/diff_note_spec.rb
View file @
aefefbf1
...
@@ -283,6 +283,12 @@ describe DiffNote do
...
@@ -283,6 +283,12 @@ describe DiffNote do
expect
(
diff_line
).
to
be
nil
expect
(
diff_line
).
to
be
nil
expect
(
subject
).
to
be_valid
expect
(
subject
).
to
be_valid
end
end
it
"does not update the position"
do
expect
(
subject
).
not_to
receive
(
:update_position
)
subject
.
save
end
end
end
it
"returns true for on_image?"
do
it
"returns true for on_image?"
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