Sha256: 63039034dfe11532da99eeeffc1ae5538c70c4049bb5d89a8991f7a65eb6c0ff

Contents?: true

Size: 598 Bytes

Versions: 127

Compression:

Stored size: 598 Bytes

Contents

module ForemanRemoteExecution
  module TemplateExtensions
    extend ActiveSupport::Concern

    included do
      # autosave => true is required so the changes of inputs are saved even if template was not changed
      has_many :foreign_input_sets, :dependent => :destroy, :foreign_key => 'template_id', :autosave => true

      def template_inputs_with_foreign(templates_stack = [])
        self.template_inputs.to_a + foreign_input_sets.map { |set| set.inputs(templates_stack) }.flatten
      end
      accepts_nested_attributes_for :foreign_input_sets, :allow_destroy => true
    end
  end
end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.4 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.1.3 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.1.2 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.1.1 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.1.0 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.0.2 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.0.1 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.6 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-14.0.0 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.5 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.4 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.3 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.2 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-12.0.7 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.1 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.2.0 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-10.1.3 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-13.0.0 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-12.0.5 app/models/concerns/foreman_remote_execution/template_extensions.rb
foreman_remote_execution-12.0.4 app/models/concerns/foreman_remote_execution/template_extensions.rb