"Fossies" - the Fresh Open Source Software Archive

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

    1 class MonitoringIssue453 < 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.create_if_not_exists(
    7       title:       'Monitoring Token',
    8       name:        'monitoring_token',
    9       area:        'HealthCheck::Base',
   10       description: 'Token for Monitoring.',
   11       options:     {
   12         form: [
   13           {
   14             display: '',
   15             null:    false,
   16             name:    'monitoring_token',
   17             tag:     'input',
   18           },
   19         ],
   20       },
   21       state:       SecureRandom.urlsafe_base64(40),
   22       preferences: {
   23         permission: ['admin.monitoring'],
   24       },
   25       frontend:    false,
   26     )
   27 
   28     Permission.create_if_not_exists(
   29       name:        'admin.monitoring',
   30       note:        'Manage %s',
   31       preferences: {
   32         translations: ['Monitoring']
   33       },
   34     )
   35 
   36   end
   37 end