summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/filter_branches.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/filter_branches.rb')
-rw-r--r--app/controllers/concerns/filter_branches.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/concerns/filter_branches.rb b/app/controllers/concerns/filter_branches.rb
new file mode 100644
index 00000000000..5376a514e19
--- /dev/null
+++ b/app/controllers/concerns/filter_branches.rb
@@ -0,0 +1,8 @@
+module FilterBranches
+ extend ActiveSupport::Concern
+
+ def filter_branches(branches)
+ if params[:search].present? && @sort
+ branches = @repository.find_similar_branches(params[:search], @sort)
+ end
+end