Skip to content

Commit

Permalink
Merge pull request #14894 from Ladas/use_correct_model_class_for_savi…
Browse files Browse the repository at this point in the history
…ng_orchestration_template

Use correct model class for saving OrchestrationTemplate
  • Loading branch information
agrare authored Apr 26, 2017
2 parents 2cd30b6 + 507e232 commit 2e972f1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ def orchestration_templates(extra_attributes = {})
orchestration_template_save_block = lambda do |_ems, inventory_collection|
hashes = inventory_collection.data.map(&:attributes)

templates = ::OrchestrationTemplate.find_or_create_by_contents(hashes)
templates = inventory_collection.model_class.find_or_create_by_contents(hashes)
inventory_collection.data.zip(templates).each do |inventory_object, template|
inventory_object.id = template.id
end
end

attributes = {
:model_class => ::OrchestrationTemplateCfn,
:model_class => ::OrchestrationTemplate,
:association => :orchestration_templates,
:custom_save_block => orchestration_template_save_block
}
Expand Down

0 comments on commit 2e972f1

Please sign in to comment.