diff options
-rw-r--r-- | acf2/model/model.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/acf2/model/model.lua b/acf2/model/model.lua index c7c48be..04d031a 100644 --- a/acf2/model/model.lua +++ b/acf2/model/model.lua @@ -140,11 +140,10 @@ function M.Model:init(context) 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) - local res = v:load{create=create} + local res = v:load(options) if res == nil and v.compute then return v:compute() end return res end @@ -153,7 +152,7 @@ function M.Model:init(context) if isinstance(v, M.Action) then local f = v.field and BoundMember(self, k, v.field) - if create then return f and f:load{create=true} end + if options.create then return f and f:load(options) end return function(var) if f then f:save(var) |