summaryrefslogtreecommitdiffstats
path: root/acf/model/field.lua
diff options
context:
space:
mode:
Diffstat (limited to 'acf/model/field.lua')
-rw-r--r--acf/model/field.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/acf/model/field.lua b/acf/model/field.lua
index 7af0698..459bb92 100644
--- a/acf/model/field.lua
+++ b/acf/model/field.lua
@@ -74,8 +74,10 @@ function Field:meta(context)
return res
end
+function Field:btype(context) return self.dtype end
+
function Field:load(context)
- local value = context.txn:get(context.addr, self.dtype)
+ local value = context.txn:get(context.addr, self:btype(context))
if value == nil then return self.default end
return value
end
@@ -94,7 +96,9 @@ end
function Field:validate(context, value) end
function Field:save(context, value)
- context.txn:set(context.addr, self.dtype, self:_validate(context, value))
+ context.txn:set(
+ context.addr, self:btype(context), self:_validate(context, value)
+ )
end
function Field:validate_saved(context)