Class: BranchesFinder
- Inherits:
-
GitRefsFinder
- Object
- GitRefsFinder
- BranchesFinder
- Defined in:
- app/finders/branches_finder.rb
Instance Method Summary collapse
- #execute(gitaly_pagination: false) ⇒ Object
-
#initialize(repository, params = {}) ⇒ BranchesFinder
constructor
A new instance of BranchesFinder.
- #total ⇒ Object
Constructor Details
#initialize(repository, params = {}) ⇒ BranchesFinder
Returns a new instance of BranchesFinder.
4 5 6 |
# File 'app/finders/branches_finder.rb', line 4 def initialize(repository, params = {}) super(repository, params) end |
Instance Method Details
#execute(gitaly_pagination: false) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/finders/branches_finder.rb', line 8 def execute(gitaly_pagination: false) if gitaly_pagination && names.blank? && search.blank? && regex.blank? repository.branches_sorted_by(sort, pagination_params) else branches = repository.branches_sorted_by(sort) branches = by_search(branches) branches = by_regex(branches) by_names(branches) end end |
#total ⇒ Object
19 20 21 |
# File 'app/finders/branches_finder.rb', line 19 def total repository.branch_count end |