summaryrefslogtreecommitdiffstats
path: root/acf/model/field.lua
diff options
context:
space:
mode:
Diffstat (limited to 'acf/model/field.lua')
-rw-r--r--acf/model/field.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/acf/model/field.lua b/acf/model/field.lua
index 707cde3..7dc20a1 100644
--- a/acf/model/field.lua
+++ b/acf/model/field.lua
@@ -181,13 +181,15 @@ end
function M.TreeNode:topology(context)
local res = super(self, M.TreeNode):topology(context)
res[1].type = 'table'
- util.extend(res, node.topology(self:load(context, true)))
+ util.extend(res, node.topology(self:load(context, {create=true})))
return res
end
-function M.TreeNode:load(context, create)
+function M.TreeNode:load(context, options)
if context.txn and not (
- create or self.create or context.txn:get(context.addr)
+ (
+ options and options.create
+ ) or self.create or context.txn:get(context.addr)
) then return end
return self.itype(context, self.iparams)
end
@@ -209,7 +211,7 @@ function M.TreeNode:save(context, value)
end
context.txn:set(context.addr, {})
- local new = self:load(context, true)
+ local new = self:load(context, {create=true})
local errors = err.ErrorDict()
for k, v in node.pairs(value) do