diff options
Diffstat (limited to 'acf/model/model.lua')
-rw-r--r-- | acf/model/model.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/acf/model/model.lua b/acf/model/model.lua index 026ada6..6878497 100644 --- a/acf/model/model.lua +++ b/acf/model/model.lua @@ -135,20 +135,21 @@ function M.Model:init(context) return res end - function mt.load(k, create) + function mt.load(k, options) local v = mt.class[k] + local create = options and options.create if isinstance(v, Field) then v = BoundMember(self, k, v) if v.compute then return v:compute() end - return v:load(create) + return v:load{create=create} end assert(mt.txn) if isinstance(v, M.Action) then local f = v.field and BoundMember(self, k, v.field) - if create then return f and f:load(true) end + if create then return f and f:load{create=true} end return function(var) if f then f:save(var) |