29 lines
758 B
Diff
29 lines
758 B
Diff
--- a/app/finders/issuable_finder.rb
|
|
+++ b/app/finders/issuable_finder.rb
|
|
@@ -7,7 +7,7 @@
|
|
# current_user - which user use
|
|
# params:
|
|
# scope: 'created-by-me' or 'assigned-to-me' or 'all'
|
|
-# state: 'open' or 'closed' or 'all'
|
|
+# state: 'opened' or 'closed' or 'all'
|
|
# group_id: integer
|
|
# project_id: integer
|
|
# milestone_title: string
|
|
@@ -175,10 +175,13 @@
|
|
end
|
|
|
|
def by_state(items)
|
|
- params[:state] ||= 'all'
|
|
-
|
|
- if items.respond_to?(params[:state])
|
|
- items.public_send(params[:state])
|
|
+ case params[:state].to_s
|
|
+ when 'closed'
|
|
+ items.closed
|
|
+ when 'merged'
|
|
+ items.respond_to?(:merged) ? items.merged : items.closed
|
|
+ when 'opened'
|
|
+ items.opened
|
|
else
|
|
items
|
|
end
|