Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
projects.thm.de
GitLab FOSS
Commits
35ce7aae
Commit
35ce7aae
authored
Jul 25, 2016
by
Douwe Maan
Browse files
Use sha1 of discussion ID.
parent
aa267678
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/helpers/notes_helper.rb
View file @
35ce7aae
...
...
@@ -57,7 +57,7 @@ def diff_view_line_data(line_code, position, line_type)
data
.
merge!
(
note_type:
LegacyDiffNote
.
name
,
discussion_id:
discussion_id
discussion_id:
Digest
::
SHA1
.
hexdigest
(
discussion_id
)
)
else
discussion_id
=
DiffNote
.
build_discussion_id
(
...
...
@@ -69,7 +69,7 @@ def diff_view_line_data(line_code, position, line_type)
data
.
merge!
(
position:
position
.
to_json
,
note_type:
DiffNote
.
name
,
discussion_id:
discussion_id
discussion_id:
Digest
::
SHA1
.
hexdigest
(
discussion_id
)
)
end
...
...
app/models/diff_note.rb
View file @
35ce7aae
...
...
@@ -34,11 +34,11 @@ def diff_attributes
end
def
discussion_id
@discussion_id
||=
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
,
position
)
@discussion_id
||=
Digest
::
SHA1
.
hexdigest
(
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
,
position
)
)
end
def
original_discussion_id
@original_discussion_id
||=
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
,
original_position
)
@original_discussion_id
||=
Digest
::
SHA1
.
hexdigest
(
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
,
original_position
)
)
end
def
position
=
(
new_position
)
...
...
app/models/legacy_diff_note.rb
View file @
35ce7aae
...
...
@@ -22,7 +22,7 @@ def diff_attributes
end
def
discussion_id
@discussion_id
||=
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
,
line_code
)
@discussion_id
||=
Digest
::
SHA1
.
hexdigest
(
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
,
line_code
)
)
end
def
diff_file_hash
...
...
app/models/note.rb
View file @
35ce7aae
...
...
@@ -145,9 +145,9 @@ def to_be_resolved?
def
discussion_id
@discussion_id
||=
if
for_merge_request?
[
:discussion
,
:note
,
id
].
join
(
"-"
)
Digest
::
SHA1
.
hexdigest
(
[
:discussion
,
:note
,
id
].
join
(
"-"
)
)
else
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
)
Digest
::
SHA1
.
hexdigest
(
self
.
class
.
build_discussion_id
(
noteable_type
,
noteable_id
||
commit_id
)
)
end
end
...
...
Write
Preview
Supports
Markdown
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