Sha256: 69c7e4bdb44e4ad08bde726637b80113a21f0abfded2f693c13cde6c05745db5

Contents?: true

Size: 676 Bytes

Versions: 5

Compression:

Stored size: 676 Bytes

Contents

module Api
  module V2
    class ConfigTemplatesController < V1::ConfigTemplatesController
      include Api::Version2
      include Api::TaxonomyScope

      before_filter :process_operatingsystems, :only => [:create, :update]

      def index
        super
        render :template => "api/v1/config_templates/index"
      end

      def show
        super
        render :template => "api/v1/config_templates/show"
      end

      def process_operatingsystems
        return unless (ct = params[:config_template]) and (operatingsystems = ct.delete(:operatingsystems))
        ct[:operatingsystem_ids] = operatingsystems.collect {|os| os[:id]}
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/app/controllers/api/v2/config_templates_controller.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/app/controllers/api/v2/config_templates_controller.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/app/controllers/api/v2/config_templates_controller.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/app/controllers/api/v2/config_templates_controller.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/app/controllers/api/v2/config_templates_controller.rb