trabajo-afectivo/db/migrate/20200419204445_setting_websocket_backend.rb

18 lines
635 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 SettingWebsocketBackend < ActiveRecord::Migration[5.2]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
Setting.create_if_not_exists(
title: 'Websocket backend',
name: 'websocket_backend',
area: 'System::WebSocket',
description: 'Defines how to reach websocket server. "websocket" is default on production, "websocketPort" is for CI',
state: Rails.env.production? ? 'websocket' : 'websocketPort',
frontend: true
)
end
end