The CAF is now populated from the YAML when a CAF is created

This commit is contained in:
2023-02-12 07:19:21 +00:00
parent d96050c4fb
commit 3b53f930be
4 changed files with 18 additions and 16 deletions

View File

@@ -32,12 +32,12 @@ class Caf < ApplicationRecord
sub_principle_item_groups.each do |key,value|
header = key["subprincipleitemgroup"]
# <%= header["type"] %> - <%= header["condition"] %><br/>
subpriitemgroup = subpri.subprincipleitemgroups.create(type: header["type"], condition: header["condition"])
subpriitemgroup = subpri.subprincipleitemgroups.create(kind: header["kind"], condition: header["condition"])
subprincipleitem = header["subprincipleitem"]
subprincipleitem.each do |subprinciple|
# <%= subprinciple %><br/>
subpriitemgroup.subprinciples.create(description: subprinciple)
subpriitemgroup.subprincipleitems.create(description: subprinciple)
end
end