diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-21 19:11:24 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-21 19:11:24 -0300 |
commit | 8d544645f0ef114586212835cf011a3e268c9ec1 (patch) | |
tree | 4ffb1d46f923bfe2f25b194f9ad0411b3a5e008e /db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb | |
parent | 261569b2466e455ff308cc54fb1db51bc8dc2880 (diff) | |
download | gitlab-ce-8d544645f0ef114586212835cf011a3e268c9ec1.tar.gz |
Add specs and add visibility level to admin groups
Diffstat (limited to 'db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb')
-rw-r--r-- | db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb deleted file mode 100644 index 62d96907c8f..00000000000 --- a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb +++ /dev/null @@ -1,22 +0,0 @@ -#Create visibility level field on DB -#Sets default_visibility_level to value on settings if not restricted -#If value is restricted takes higher visibility level allowed - -class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration - def up - add_column :application_settings, :default_group_visibility, :integer - execute("UPDATE application_settings SET default_group_visibility = #{allowed_visibility_level}") - end - - def down - remove_column :application_settings, :default_group_visibility - end - - private - - 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 |