diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2013-12-11 13:43:17 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2013-12-11 13:47:25 +0200 |
commit | 28da76182154c395dbcb64f4a56bd8cfb3f51886 (patch) | |
tree | 6dd9ed6a572ce6d39f87478ee5cf01cbeae1eb08 /acf2/model/model.lua | |
parent | 3204822db1ae50aa031446b22e7ba94845a9c7c1 (diff) | |
download | aconf-28da76182154c395dbcb64f4a56bd8cfb3f51886.tar.bz2 aconf-28da76182154c395dbcb64f4a56bd8cfb3f51886.tar.xz |
model: pass dereferencing option to fields from models
Diffstat (limited to 'acf2/model/model.lua')
-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) |