123456789101112131415161718192021222324252627282930313233343536 |
- class SettingUpdates3 < ActiveRecord::Migration[6.1]
- def change
- return if !Setting.exists?(name: 'system_init_done')
- settings_update = [
- {
- name: 'idoit_integration',
- description: 'Defines if the i-doit (https://www.i-doit.org/) integration is enabled or not.',
- },
- {
- title: 'Microsoft 365 App Credentials',
- name: 'auth_microsoft_office365_credentials',
- description: 'Enables user authentication via Microsoft 365.',
- },
- ]
- settings_update.each do |setting|
- fetched_setting = Setting.find_by(name: setting[:name])
- next if !fetched_setting
- if setting[:title]
-
- fetched_setting.title = setting[:title]
- end
- if setting[:description]
-
- fetched_setting.description = setting[:description]
- end
- fetched_setting.save!
- end
- end
- end
|