diff options
Diffstat (limited to 'acf/model/init.lua')
-rw-r--r-- | acf/model/init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/acf/model/init.lua b/acf/model/init.lua index 653464d..78f5032 100644 --- a/acf/model/init.lua +++ b/acf/model/init.lua @@ -85,9 +85,11 @@ function M.Reference:follow(context, value) return context.txn:fetch(pth.rawjoin(self:abs_scope(context), value)) end -function M.Reference:load(context) +function M.Reference:load(context, options) local ref = super(self, M.Reference):load(context) - return (context.txn and ref) and self:follow(context, ref) or ref + return ( + (not options or options.dereference ~= false) and context.txn and ref + ) and self:follow(context, ref) or ref end function M.Reference:_validate(context, value) |