"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20161117000003_store_config_name_update_issue_428.rb" (25 Mar 2021, 808 Bytes) of package /linux/www/zammad-4.0.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "20161117000003_store_config_name_update_issue_428.rb": 3.4.1_vs_3.5.0.

    1 class StoreConfigNameUpdateIssue428 < ActiveRecord::Migration[4.2]
    2   def up
    3     # return if it's a new setup
    4     return if !Setting.exists?(name: 'system_init_done')
    5 
    6     setting = Setting.find_by(name: 'storage')
    7     return if !setting
    8 
    9     setting.name = 'storage_provider'
   10     setting.options = {
   11       form: [
   12         {
   13           display:  '',
   14           null:     true,
   15           name:     'storage_provider',
   16           tag:      'select',
   17           tranlate: true,
   18           options:  {
   19             'DB'   => 'Database',
   20             'File' => 'Filesystem',
   21           },
   22         },
   23       ],
   24     }
   25     setting.preferences = {
   26       controller:             'SettingsAreaStorageProvider',
   27       online_service_disable: true,
   28       permission:             ['admin.system'],
   29     }
   30     setting.save!
   31   end
   32 end