-
- Downloads
Add a series of migrations changing the model-level design of protected branch access levels.
1. Remove the `developers_can_push` and `developers_can_merge` boolean columns. 2. Add two new tables, `protected_branches_push_access`, and `protected_branches_merge_access`. Each row of these 'access' tables is linked to a protected branch, and uses a `access_level` column to figure out settings for the protected branch. 3. The `access_level` column is intended to be used with rails' `enum`, with `:masters` at index 0 and `:developers` at index 1. 4. Doing it this way has a few advantages: - Cleaner path to planned EE features where a protected branch is accessible only by certain users or groups. - Rails' `enum` doesn't allow a declaration like this due to the duplicates. This approach doesn't have this problem. enum can_be_pushed_by: [:masters, :developers] enum can_be_merged_by: [:masters, :developers]
Showing
- db/migrate/20160705054938_add_protected_branches_push_access.rb 15 additions, 0 deletions...rate/20160705054938_add_protected_branches_push_access.rb
- db/migrate/20160705054952_add_protected_branches_merge_access.rb 15 additions, 0 deletions...ate/20160705054952_add_protected_branches_merge_access.rb
- db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb 33 additions, 0 deletions...evelopers_can_merge_to_protected_branches_merge_access.rb
- db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb 33 additions, 0 deletions..._developers_can_push_to_protected_branches_push_access.rb
- db/migrate/20160705055809_remove_developers_can_push_from_protected_branches.rb 21 additions, 0 deletions...809_remove_developers_can_push_from_protected_branches.rb
- db/migrate/20160705055813_remove_developers_can_merge_from_protected_branches.rb 21 additions, 0 deletions...13_remove_developers_can_merge_from_protected_branches.rb
- db/schema.rb 22 additions, 4 deletionsdb/schema.rb
Loading
Please register or sign in to comment