Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-03-01 19:15:46 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-03-06 18:47:44 +0300
commitbd9887e61701492dc331d188d5b0e1740b037ea3 (patch)
tree6f39ac52c9e6f406565fb5df83f018e0ce355d6f /app/controllers/projects/settings
parent43958926c5310642f2fc0c6f72952004d2ca5089 (diff)
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.rb11
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