diff options
-rw-r--r-- | acf2/model/model.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/acf2/model/model.lua b/acf2/model/model.lua index 5b04001..46f0c4d 100644 --- a/acf2/model/model.lua +++ b/acf2/model/model.lua @@ -144,8 +144,9 @@ function M.Model:init(context) if isinstance(v, Field) then v = BoundMember(self, k, v) - if v.compute then return v:compute() end - return v:load{create=create} + local res = v:load{create=create} + if res == nil and v.compute then return v:compute() end + return res end assert(mt.txn) |