diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-22 01:11:24 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-22 01:11:24 +0300 |
commit | 8d544645f0ef114586212835cf011a3e268c9ec1 (patch) | |
tree | 4ffb1d46f923bfe2f25b194f9ad0411b3a5e008e /db/migrate/20160301124843_add_visibility_level_to_groups.rb | |
parent | 261569b2466e455ff308cc54fb1db51bc8dc2880 (diff) |
Add specs and add visibility level to admin groups
Diffstat (limited to 'db/migrate/20160301124843_add_visibility_level_to_groups.rb')
-rw-r--r-- | db/migrate/20160301124843_add_visibility_level_to_groups.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/db/migrate/20160301124843_add_visibility_level_to_groups.rb b/db/migrate/20160301124843_add_visibility_level_to_groups.rb index cef553981e7..89b5ac19983 100644 --- a/db/migrate/20160301124843_add_visibility_level_to_groups.rb +++ b/db/migrate/20160301124843_add_visibility_level_to_groups.rb @@ -1,6 +1,12 @@ class AddVisibilityLevelToGroups < ActiveRecord::Migration def change #All groups public by default - add_column :namespaces, :visibility_level, :integer, null: false, default: 20 + add_column :namespaces, :visibility_level, :integer, null: false, default: allowed_visibility_level + end + + def allowed_visibility_level + # TODO: Don't use `current_application_settings` + allowed_levels = Gitlab::VisibilityLevel.values - current_application_settings.restricted_visibility_levels + allowed_levels.max end end |