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
Léo-Paul Géneau
gitlab-ce
Commits
424cb9cc
Commit
424cb9cc
authored
Feb 18, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
💄
Cosmetic changes
parent
72009896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
app/services/task_service.rb
app/services/task_service.rb
+21
-21
No files found.
app/services/task_service.rb
View file @
424cb9cc
...
@@ -89,18 +89,18 @@ class TaskService
...
@@ -89,18 +89,18 @@ class TaskService
#
#
def
new_note
(
note
)
def
new_note
(
note
)
# Skip system notes, like status changes and cross-references
# Skip system notes, like status changes and cross-references
unless
note
.
system
return
if
note
.
system
project
=
note
.
project
target
=
note
.
noteable
author
=
note
.
author
mark_pending_tasks_as_done
(
target
,
author
)
project
=
note
.
project
target
=
note
.
noteable
author
=
note
.
author
mentioned_users
=
build_mentioned_users
(
project
,
note
,
author
)
mark_pending_tasks_as_done
(
target
,
author
)
mentioned_users
.
each
do
|
user
|
mentioned_users
=
build_mentioned_users
(
project
,
note
,
author
)
create_task
(
project
,
target
,
author
,
user
,
Task
::
MENTIONED
,
note
)
end
mentioned_users
.
each
do
|
user
|
create_task
(
project
,
target
,
author
,
user
,
Task
::
MENTIONED
,
note
)
end
end
end
end
...
@@ -111,19 +111,19 @@ class TaskService
...
@@ -111,19 +111,19 @@ class TaskService
#
#
def
update_note
(
note
,
current_user
)
def
update_note
(
note
,
current_user
)
# Skip system notes, like status changes and cross-references
# Skip system notes, like status changes and cross-references
unless
note
.
system
return
if
note
.
system
project
=
note
.
project
target
=
note
.
noteable
author
=
current_user
mark_pending_tasks_as_done
(
target
,
author
)
project
=
note
.
project
target
=
note
.
noteable
author
=
current_user
mark_pending_tasks_as_done
(
target
,
author
)
mentioned_users
=
build_mentioned_users
(
project
,
note
,
author
)
mentioned_users
=
build_mentioned_users
(
project
,
note
,
author
)
mentioned_users
.
each
do
|
user
|
mentioned_users
.
each
do
|
user
|
unless
pending_tasks
(
mentioned_user
,
project
,
target
,
note:
note
,
action:
Task
::
MENTIONED
).
exists?
unless
pending_tasks
(
mentioned_user
,
project
,
target
,
note:
note
,
action:
Task
::
MENTIONED
).
exists?
create_task
(
project
,
target
,
author
,
user
,
Task
::
MENTIONED
,
note
)
create_task
(
project
,
target
,
author
,
user
,
Task
::
MENTIONED
,
note
)
end
end
end
end
end
end
end
...
@@ -159,10 +159,10 @@ class TaskService
...
@@ -159,10 +159,10 @@ class TaskService
end
end
def
pending_tasks
(
user
,
project
,
target
,
options
=
{})
def
pending_tasks
(
user
,
project
,
target
,
options
=
{})
options
.
reverse_merge
(
{
options
.
reverse_merge
(
project:
project
,
project:
project
,
target:
target
target:
target
}
)
)
user
.
tasks
.
pending
.
where
(
options
)
user
.
tasks
.
pending
.
where
(
options
)
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