diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-02-22 13:56:38 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-02-22 13:59:15 -0300 |
commit | 45c77dacbc7d9d71e6a32feb0640400bd266c357 (patch) | |
tree | 128ca00f0bf1f0eed9ad3b57a41e1bf95b27aaf0 /app/helpers | |
parent | 31d1b2ca8c338281f3fac6dd862c988b721fa39d (diff) | |
download | gitlab-ce-45c77dacbc7d9d71e6a32feb0640400bd266c357.tar.gz |
Move can_current_user_push_to_branch to Presenter
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/tree_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index 0a4da0ef3fc..f5733b4b57c 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -55,7 +55,9 @@ module TreeHelper def tree_edit_branch(project = @project, ref = @ref) return unless can_edit_tree?(project, ref) - if project.user_can_push_to_branch?(current_user, ref) + project = project.present(current_user: current_user) + + if project.can_current_user_push_to_branch?(ref) ref else project = tree_edit_project(project) |