Sha256: 6c6a71d8517c56af9eb01d530284e5a22bf884d09c62591ba3cc1ed3f087bbf9

Contents?: true

Size: 574 Bytes

Versions: 31

Compression:

Stored size: 574 Bytes

Contents

module InsightsCloud
  class SettingsController < ::ApplicationController
    def show
      render_setting(:insightsSyncEnabled, :allow_auto_insights_sync)
    end

    def update
      Setting[:allow_auto_insights_sync] = settings_params
      render_setting(:insightsSyncEnabled, :allow_auto_insights_sync)
    end

    private

    def render_setting(node_name, setting)
      render json: {
        node_name => Setting[setting],
      }
    end

    def settings_params
      ActiveModel::Type::Boolean.new.cast(params.require(:insightsSyncEnabled))
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
foreman_rh_cloud-5.0.38 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-5.0.37 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-5.0.36 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.18.1 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-1.0.18 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.18 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-1.0.17 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.17 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.16 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-1.0.16 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-1.0.15 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.15 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-3.0.14 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.14 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-1.0.14 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-0.9.14 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-0.9.13.1 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-1.0.13.1 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-2.0.13.1 app/controllers/insights_cloud/settings_controller.rb
foreman_rh_cloud-0.9.13 app/controllers/insights_cloud/settings_controller.rb