Commit e089b11b7a4026acc7706e519682f4b7141b2bcd

Authored by Dmitriy Zaporozhets
1 parent 88781783

Add BranchesHelper

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 11 additions and 0 deletions   Show diff stats
app/helpers/branches_helper.rb 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +module BranchesHelper
  2 + def can_remove_branch?(project, branch_name)
  3 + if project.protected_branch? branch_name
  4 + false
  5 + elsif branch_name == project.repository.root_ref
  6 + false
  7 + else
  8 + can?(current_user, :push_code, project)
  9 + end
  10 + end
  11 +end
... ...