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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
f8ea52c3
Commit
f8ea52c3
authored
Jun 10, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove thread vars usage from API notes and mr's
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
a7be3dfa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
35 deletions
+28
-35
app/observers/note_observer.rb
app/observers/note_observer.rb
+2
-2
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+8
-11
lib/api/notes.rb
lib/api/notes.rb
+18
-22
No files found.
app/observers/note_observer.rb
View file @
f8ea52c3
...
@@ -5,7 +5,7 @@ class NoteObserver < BaseObserver
...
@@ -5,7 +5,7 @@ class NoteObserver < BaseObserver
# Skip system notes, like status changes and cross-references.
# Skip system notes, like status changes and cross-references.
# Skip wall notes to prevent spamming of dashboard
# Skip wall notes to prevent spamming of dashboard
if
note
.
noteable_type
.
present?
&&
!
note
.
system
if
note
.
noteable_type
.
present?
&&
!
note
.
system
event_service
.
leave_note
(
note
,
current_use
r
)
event_service
.
leave_note
(
note
,
note
.
autho
r
)
end
end
unless
note
.
system?
unless
note
.
system?
...
@@ -18,6 +18,6 @@ class NoteObserver < BaseObserver
...
@@ -18,6 +18,6 @@ class NoteObserver < BaseObserver
end
end
def
after_update
(
note
)
def
after_update
(
note
)
note
.
notice_added_references
(
note
.
project
,
current_use
r
)
note
.
notice_added_references
(
note
.
project
,
note
.
autho
r
)
end
end
end
end
lib/api/merge_requests.rb
View file @
f8ea52c3
...
@@ -184,7 +184,6 @@ module API
...
@@ -184,7 +184,6 @@ module API
# POST /projects/:id/merge_request/:merge_request_id/comments
# POST /projects/:id/merge_request/:merge_request_id/comments
#
#
post
":id/merge_request/:merge_request_id/comments"
do
post
":id/merge_request/:merge_request_id/comments"
do
set_current_user_for_thread
do
required_attributes!
[
:note
]
required_attributes!
[
:note
]
merge_request
=
user_project
.
merge_requests
.
find
(
params
[
:merge_request_id
])
merge_request
=
user_project
.
merge_requests
.
find
(
params
[
:merge_request_id
])
...
@@ -198,7 +197,5 @@ module API
...
@@ -198,7 +197,5 @@ module API
end
end
end
end
end
end
end
end
end
end
end
lib/api/notes.rb
View file @
f8ea52c3
...
@@ -41,7 +41,6 @@ module API
...
@@ -41,7 +41,6 @@ module API
# Example Request:
# Example Request:
# POST /projects/:id/notes
# POST /projects/:id/notes
post
":id/notes"
do
post
":id/notes"
do
set_current_user_for_thread
do
required_attributes!
[
:body
]
required_attributes!
[
:body
]
@note
=
user_project
.
notes
.
new
(
note:
params
[
:body
])
@note
=
user_project
.
notes
.
new
(
note:
params
[
:body
])
...
@@ -55,7 +54,6 @@ module API
...
@@ -55,7 +54,6 @@ module API
not_found!
not_found!
end
end
end
end
end
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
NOTEABLE_TYPES
.
each
do
|
noteable_type
|
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
noteables_str
=
noteable_type
.
to_s
.
underscore
.
pluralize
...
@@ -99,7 +97,6 @@ module API
...
@@ -99,7 +97,6 @@ module API
# POST /projects/:id/issues/:noteable_id/notes
# POST /projects/:id/issues/:noteable_id/notes
# POST /projects/:id/snippets/:noteable_id/notes
# POST /projects/:id/snippets/:noteable_id/notes
post
":id/
#{
noteables_str
}
/:
#{
noteable_id_str
}
/notes"
do
post
":id/
#{
noteables_str
}
/:
#{
noteable_id_str
}
/notes"
do
set_current_user_for_thread
do
required_attributes!
[
:body
]
required_attributes!
[
:body
]
@noteable
=
user_project
.
send
(
:"
#{
noteables_str
}
"
).
find
(
params
[
:"
#{
noteable_id_str
}
"
])
@noteable
=
user_project
.
send
(
:"
#{
noteables_str
}
"
).
find
(
params
[
:"
#{
noteable_id_str
}
"
])
...
@@ -116,5 +113,4 @@ module API
...
@@ -116,5 +113,4 @@ module API
end
end
end
end
end
end
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