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
a1d42a79
Commit
a1d42a79
authored
Dec 03, 2019
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept line_code and position when importing
parent
83c2d05b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/concerns/diff_positionable_note.rb
app/models/concerns/diff_positionable_note.rb
+1
-1
app/models/diff_note.rb
app/models/diff_note.rb
+2
-2
No files found.
app/models/concerns/diff_positionable_note.rb
View file @
a1d42a79
...
...
@@ -5,7 +5,7 @@ module DiffPositionableNote
included
do
delegate
:on_text?
,
:on_image?
,
to: :position
,
allow_nil:
true
before_validation
:set_original_position
,
on: :create
before_validation
:update_position
,
on: :create
,
if: :on_text?
before_validation
:update_position
,
on: :create
,
if: :on_text?
,
unless: :importing?
serialize
:original_position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/ActiveRecordSerialize
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/ActiveRecordSerialize
...
...
app/models/diff_note.rb
View file @
a1d42a79
...
...
@@ -21,7 +21,7 @@ class DiffNote < Note
validate
:positions_complete
validate
:verify_supported
before_validation
:set_line_code
,
if: :on_text?
before_validation
:set_line_code
,
if: :on_text?
,
unless: :importing?
after_save
:keep_around_commits
,
unless: :importing?
after_commit
:create_diff_file
,
on: :create
...
...
@@ -104,7 +104,7 @@ class DiffNote < Note
end
def
should_create_diff_file?
false
&&
on_text?
&&
note_diff_file
.
nil?
&&
start_of_discussion?
on_text?
&&
note_diff_file
.
nil?
&&
start_of_discussion?
end
def
fetch_diff_file
...
...
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