20160506000001_update_setting_placeholder.rb 452 B

12345678910111213141516171819202122
  1. class UpdateSettingPlaceholder < ActiveRecord::Migration
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. names = %w(
  6. product_name
  7. organization
  8. system_id
  9. fqdn
  10. http_type
  11. ticket_hook
  12. )
  13. names.each { |name|
  14. setting = Setting.find_by(name: name)
  15. next if !setting
  16. setting.preferences[:placeholder] = true
  17. setting.save
  18. }
  19. end
  20. end