diff options
author | James Lopez <james@jameslopez.es> | 2017-07-07 12:38:01 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-07-07 12:38:01 +0300 |
commit | 377244dd45773a5d587eaf3b75ba64702229e34e (patch) | |
tree | fc5327b7d466bc3b352999792edd10e7e88ff566 /app/finders/issuable_finder.rb | |
parent | bfe5f2d19f5be3dd4e039fa5b2b0b6b27c748db9 (diff) |
refactor filters
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r-- | app/finders/issuable_finder.rb | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 7bc2117f61e..39427d83669 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -19,6 +19,8 @@ # iids: integer[] # class IssuableFinder + include Gitlab::Database::CreatedAtFilter + NONE = '0'.freeze IRRELEVANT_PARAMS_FOR_CACHE_KEY = %i[utf8 sort page].freeze @@ -408,18 +410,6 @@ class IssuableFinder params[:non_archived].present? ? items.non_archived : items end - def by_created_at(items) - if params[:created_after].present? - items = items.where(items.klass.arel_table[:created_at].gteq(params[:created_after])) - end - - if params[:created_before].present? - items = items.where(items.klass.arel_table[:created_at].lteq(params[:created_before])) - end - - items - end - def current_user_related? params[:scope] == 'created-by-me' || params[:scope] == 'authored' || params[:scope] == 'assigned-to-me' end |