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
19f74903
Commit
19f74903
authored
Sep 17, 2019
by
Marc Schwede
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added optional for Todo state
cf.
https://gitlab.com/gitlab-org/gitlab/merge_requests/16837#note_217807588
parent
a986241e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/finders/todos_finder.rb
app/finders/todos_finder.rb
+1
-1
app/models/todo.rb
app/models/todo.rb
+2
-2
No files found.
app/finders/todos_finder.rb
View file @
19f74903
...
...
@@ -51,7 +51,7 @@ class TodosFinder
#
# target - The value of the `target_type` column, such as `Issue`.
# state - The value of the `state` column, such as `pending` or `done`.
def
any_for_target?
(
target
,
*
state
)
def
any_for_target?
(
target
,
state
=
nil
)
current_user
.
todos
.
any_for_target?
(
target
,
state
)
end
...
...
app/models/todo.rb
View file @
19f74903
...
...
@@ -93,8 +93,8 @@ class Todo < ApplicationRecord
#
# target - The value of the `target_type` column, such as `Issue`.
# state - The value of the `state` column, such as `pending` or `done`.
def
any_for_target?
(
target
,
*
state
)
state
.
empty
?
?
exists?
(
target:
target
)
:
exists?
(
target:
target
,
state:
state
)
def
any_for_target?
(
target
,
state
=
nil
)
state
.
nil
?
?
exists?
(
target:
target
)
:
exists?
(
target:
target
,
state:
state
)
end
# Updates the state of a relation of todos to the new state.
...
...
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