diff options
Diffstat (limited to 'doc/development/cascading_settings.md')
-rw-r--r-- | doc/development/cascading_settings.md | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/doc/development/cascading_settings.md b/doc/development/cascading_settings.md index 389623e68d8..42f4b5dd6f3 100644 --- a/doc/development/cascading_settings.md +++ b/doc/development/cascading_settings.md @@ -23,13 +23,13 @@ Settings are not cascading by default. To define a cascading setting, take the f 1. In the `NamespaceSetting` model, define the new attribute using the `cascading_attr` helper method. You can use an array to define multiple attributes on a single line. - ```ruby - class NamespaceSetting - include CascadingNamespaceSettingAttribute + ```ruby + class NamespaceSetting + include CascadingNamespaceSettingAttribute - cascading_attr :delayed_project_removal - end - ``` + cascading_attr :delayed_project_removal + end + ``` 1. Create the database columns. @@ -37,21 +37,21 @@ Settings are not cascading by default. To define a cascading setting, take the f The helper creates four columns, two each in `namespace_settings` and `application_settings`. - ```ruby - class AddDelayedProjectRemovalCascadingSetting < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings + ```ruby + class AddDelayedProjectRemovalCascadingSetting < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings - enable_lock_retries! + enable_lock_retries! - def up - add_cascading_namespace_setting :delayed_project_removal, :boolean, default: false, null: false - end + def up + add_cascading_namespace_setting :delayed_project_removal, :boolean, default: false, null: false + end - def down - remove_cascading_namespace_setting :delayed_project_removal - end - end - ``` + def down + remove_cascading_namespace_setting :delayed_project_removal + end + end + ``` Existing settings being converted to a cascading setting will require individual migrations to add columns and change existing columns. Use the specifications |