trabajo-afectivo/db/migrate/20170421000001_pretty_date_options_added.rb

49 lines
1.3 KiB
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
2017-09-08 08:28:34 +00:00
class PrettyDateOptionsAdded < ActiveRecord::Migration[4.2]
def up
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
Setting.create_or_update(
title: 'Pretty Date',
name: 'pretty_date_format',
area: 'System::Branding',
description: 'Defines pretty date format.',
options: {
form: [
{
display: '',
null: false,
name: 'pretty_date_format',
tag: 'select',
options: {
relative: 'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"',
absolute: 'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"',
},
},
],
},
preferences: {
render: true,
prio: 10,
permission: ['admin.branding'],
},
state: 'relative',
frontend: true
)
Scheduler.create_or_update(
name: 'Import Jobs',
method: 'ImportJob.start_registered',
period: 1.hour,
prio: 1,
active: true,
updated_by_id: 1,
created_by_id: 1
)
end
end