20180919000000_setting_update_pretty_date_format.rb 372 B

1234567891011121314
  1. class SettingUpdatePrettyDateFormat < ActiveRecord::Migration[5.1]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. setting = Setting.find_by(name: 'pretty_date_format')
  6. return if !setting
  7. setting.options[:form][0][:options][:timestamp] = 'timestamp - e. g. "2018-08-30 14:30"'
  8. setting.save!
  9. end
  10. end