trabajo-afectivo/db/migrate/20180919000000_setting_update_pretty_date_format.rb

17 lines
449 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class SettingUpdatePrettyDateFormat < ActiveRecord::Migration[5.1]
def up
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
setting = Setting.find_by(name: 'pretty_date_format')
return if !setting
setting.options[:form][0][:options][:timestamp] = 'timestamp - e. g. "2018-08-30 14:30"'
setting.save!
end
end