summaryrefslogtreecommitdiffstats
path: root/acf2/model
diff options
context:
space:
mode:
Diffstat (limited to 'acf2/model')
-rw-r--r--acf2/model/field.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/acf2/model/field.lua b/acf2/model/field.lua
index f668b90..5a699f6 100644
--- a/acf2/model/field.lua
+++ b/acf2/model/field.lua
@@ -67,6 +67,13 @@ function M.Field:init(params)
super(self, M.Field):init(params)
+ for _, param in ipairs{'compute', 'store', 'editable'} do
+ local func = self[param]
+ if type(func) == 'string' then
+ self[param] = function(self, obj, ...) return obj[func](obj, ...) end
+ end
+ end
+
if type(self.editable) ~= 'function' then
function self.editable(obj) return params.editable end
end