diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-01 10:15:46 -0600 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-06 09:47:44 -0600 |
commit | bd9887e61701492dc331d188d5b0e1740b037ea3 (patch) | |
tree | 6f39ac52c9e6f406565fb5df83f018e0ce355d6f /app/controllers/projects/settings | |
parent | 43958926c5310642f2fc0c6f72952004d2ca5089 (diff) | |
download | gitlab-ce-bd9887e61701492dc331d188d5b0e1740b037ea3.tar.gz |
Fixed repository_controller_spec
also added an #open_branches private method
Diffstat (limited to 'app/controllers/projects/settings')
-rw-r--r-- | app/controllers/projects/settings/repository_controller.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index 7a1edee0822..a9d10dcddef 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -5,7 +5,7 @@ module Projects def show @deploy_keys = DeployKeysPresenter - .new(@project, current_user: @current_user) + .new(@project, current_user: current_user) define_protected_branches end @@ -37,10 +37,13 @@ module Projects } end + def open_branches + branches = @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } } + { open_branches: branches } + end + def load_gon_index - open_branches = @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } } - params = { open_branches: open_branches } - gon.push(params.merge(access_levels_options)) + gon.push(open_branches.merge(access_levels_options)) end end end |