summaryrefslogtreecommitdiffstats
path: root/aconf/model
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-03-16 23:54:28 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-03-25 09:02:57 +0200
commit3fda494d56bcdd1e35e1a24b37b44f1eb885346b (patch)
treea236f67c06326213f8a12e1e89d5bc2cf7d0bbc0 /aconf/model
parenta939dcf652a0287c5c02371216376d06f5507802 (diff)
downloadaconf-3fda494d56bcdd1e35e1a24b37b44f1eb885346b.tar.bz2
aconf-3fda494d56bcdd1e35e1a24b37b44f1eb885346b.tar.xz
model: do not pass field to its function parameters
Diffstat (limited to 'aconf/model')
-rw-r--r--aconf/model/field.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/aconf/model/field.lua b/aconf/model/field.lua
index 658aa7f..8b300a5 100644
--- a/aconf/model/field.lua
+++ b/aconf/model/field.lua
@@ -69,7 +69,7 @@ function 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
+ self[param] = function(obj, ...) return obj[func](obj, ...) end
end
end
@@ -112,7 +112,7 @@ function M.Field:_editable(context)
end
if type(self.editable) == 'function' then
- return self:editable(context.parent) and true or false
+ return self.editable(context.parent) and true or false
end
return self.editable
@@ -161,7 +161,7 @@ function M.Field:load(context)
end
function M.Field:_compute(context)
- return self:compute(context.parent, context.txn)
+ return self.compute(context.parent, context.txn)
end
function M.Field:_load(context) return context.txn:get(context.addr) end
@@ -209,7 +209,7 @@ function M.Field:validate(context, value) end
function M.Field:save(context, value)
self:check_editable(context)
- if self.store then self:store(context.parent, value, context.txn)
+ if self.store then self.store(context.parent, value, context.txn)
else self:_save(context, self:_validate(context, value)) end
end