20200419204445_setting_websocket_backend.rb 558 B

123456789101112131415
  1. class SettingWebsocketBackend < ActiveRecord::Migration[5.2]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'Websocket backend',
  7. name: 'websocket_backend',
  8. area: 'System::WebSocket',
  9. description: 'Defines how to reach websocket server. "websocket" is default on production, "websocketPort" is for CI',
  10. state: Rails.env.production? ? 'websocket' : 'websocketPort',
  11. frontend: true
  12. )
  13. end
  14. end