summaryrefslogtreecommitdiff
path: root/app/helpers/todos_helper.rb
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-05-03 10:30:33 -0500
committerJacob Schatz <jschatz1@gmail.com>2016-05-25 08:15:20 -0400
commit2c8000e302c7c5382caaa235ece133ade687c7ac (patch)
treed70b2ca0731975bbe19a9c7db9d5202ff0473ee6 /app/helpers/todos_helper.rb
parent7586807fc3e01d641dfb1211e7c0a6a92e5e68c0 (diff)
downloadgitlab-ce-2c8000e302c7c5382caaa235ece133ade687c7ac.tar.gz
Move conditional to a method
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r--app/helpers/todos_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index e01ff8407c3..150d826ac44 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -46,6 +46,10 @@ module TodosHelper
end
end
+ def show_todo_state?(todo)
+ (todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && ['closed', 'merged'].include?(todo.target.state)
+ end
+
def todos_filter_params
{
state: params[:state],