diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-14 06:42:16 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 12:50:39 +0300 |
commit | f2df2966aabc601dd1d6a6f9e75ead84db8a2765 (patch) | |
tree | 541e68b69d76145ef55b04f6907ceaefe5a88b3d /app/controllers/projects/protected_branches_controller.rb | |
parent | c647540c1010fd1e51bced1db90947aa00c83fa8 (diff) |
Humanize protected branches' access levels at one location.
1. The model now contains this humanization data, which is the once
source of truth.
2. Previously, this was being listed out in the dropdown component as well.
Diffstat (limited to 'app/controllers/projects/protected_branches_controller.rb')
-rw-r--r-- | app/controllers/projects/protected_branches_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index 126358bfe77..ddf1824ccb9 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -9,7 +9,9 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController def index @protected_branch = @project.protected_branches.new - gon.push({ open_branches: @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } } }) + gon.push({ open_branches: @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } }, + push_access_levels: ProtectedBranch::PushAccessLevel.human_access_levels.map { |id, text| { id: id, text: text } }, + merge_access_levels: ProtectedBranch::MergeAccessLevel.human_access_levels.map { |id, text| { id: id, text: text } } }) end def create |