Sha256: 12744eaa95b386cb545028fcddb94860d07e9903a34af0c979370cc480bfd085
Contents?: true
Size: 1.23 KB
Versions: 49
Compression:
Stored size: 1.23 KB
Contents
# frozen_string_literal: true # # Manage the system configuration page # module CoreSystemConfigurationsController include CoreController # # Edit the system configuration # def edit load_configuration end # # Update and log the system configuration changes # def update # @system_configuration.update_attributes_and_log! @current_admin_user, system_configuration_params SystemConfiguration.configuration.update! system_configuration_params if SystemConfiguration.switchboard_configured? flash[:info] = 'System Configuration Updated, sync job running in the background' Cron::SwitchboardSyncConfiguration.perform_later else flash[:info] = 'System Configuration Updated' end redirect_to index_path rescue StandardError => error log_controller_error error load_configuration render :edit end private # # Get the system configuration properties from the request # def system_configuration_params params[:system_configuration].permit(%i[switchboard_base_url switchboard_stack_id switchboard_stack_api_token]) end # # Load the current system configuration # def load_configuration @system_configuration = SystemConfiguration.configuration end end
Version data entries
49 entries across 49 versions & 1 rubygems