Class: InsightsCloud::SettingsController
- Inherits:
 - 
      ApplicationController
      
        
- Object
 - ApplicationController
 - InsightsCloud::SettingsController
 
 
- Defined in:
 - app/controllers/insights_cloud/settings_controller.rb
 
Instance Method Summary collapse
Instance Method Details
#set_org_parameter ⇒ Object
      12 13 14 15 16 17 18 19 20 21 22 23 24  | 
    
      # File 'app/controllers/insights_cloud/settings_controller.rb', line 12 def set_org_parameter parameter = params.require(:parameter) new_value = ActiveModel::Type::Boolean.new.cast(params.require(:value)) org_id = params.require(:organization_id) organization = Organization..find(org_id) org_param = organization.organization_parameters.find_or_create_by(name: parameter) do |org_param| org_param.name = parameter end org_param.value = new_value org_param.save! end  | 
  
#show ⇒ Object
      3 4 5  | 
    
      # File 'app/controllers/insights_cloud/settings_controller.rb', line 3 def show render_setting(:insightsSyncEnabled, :allow_auto_insights_sync) end  | 
  
#update ⇒ Object
      7 8 9 10  | 
    
      # File 'app/controllers/insights_cloud/settings_controller.rb', line 7 def update Setting[:allow_auto_insights_sync] = settings_params render_setting(:insightsSyncEnabled, :allow_auto_insights_sync) end  |