From 0e7b11021457934dd99f764ee24359a86146e976 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Mon, 17 Mar 2014 19:43:52 +0200 Subject: model: fetch objects via metatable function when possible --- aconf/model/field.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'aconf/model/field.lua') diff --git a/aconf/model/field.lua b/aconf/model/field.lua index 8b300a5..26711f2 100644 --- a/aconf/model/field.lua +++ b/aconf/model/field.lua @@ -335,7 +335,9 @@ function M.TreeNode:save(context, value) local path = context.path if value == path then return end - if type(value) == 'string' then value = context.txn:fetch(value) end + if type(value) == 'string' then + value = node.fetch(context.parent, value) + end if object.isinstance(value, node.TreeNode) and node.path(value) == path then return end -- cgit v1.2.3