"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20170117000001_unable_to_enable_time_accounting_633.rb" (25 Mar 2021, 1297 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 "20170117000001_unable_to_enable_time_accounting_633.rb": 3.4.1_vs_3.5.0.

    1 class UnableToEnableTimeAccounting633 < ActiveRecord::Migration[4.2]
    2   def up
    3 
    4     # return if it's a new setup
    5     return if !Setting.exists?(name: 'system_init_done')
    6 
    7     Setting.create_if_not_exists(
    8       title:       'Time Accounting',
    9       name:        'time_accounting',
   10       area:        'Web::Base',
   11       description: 'Enable time accounting.',
   12       options:     {
   13         form: [
   14           {
   15             display: '',
   16             null:    true,
   17             name:    'time_accounting',
   18             tag:     'boolean',
   19             options: {
   20               true  => 'yes',
   21               false => 'no',
   22             },
   23           },
   24         ],
   25       },
   26       preferences: {
   27         authentication: true,
   28         permission:     ['admin.time_accounting'],
   29       },
   30       state:       false,
   31       frontend:    true
   32     )
   33 
   34     Setting.create_if_not_exists(
   35       title:       'Time Accounting Selector',
   36       name:        'time_accounting_selector',
   37       area:        'Web::Base',
   38       description: 'Enable time accounting for this tickets.',
   39       options:     {
   40         form: [
   41           {},
   42         ],
   43       },
   44       preferences: {
   45         authentication: true,
   46         permission:     ['admin.time_accounting'],
   47       },
   48       state:       {},
   49       frontend:    true
   50     )
   51   end
   52 end