From ede05534efb0e4c373e661832de1a146482e1b3a Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Sun, 1 Dec 2013 13:20:50 +0200 Subject: reference choice filters, disable choices for client --- acf2/transaction/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'acf2/transaction') diff --git a/acf2/transaction/init.lua b/acf2/transaction/init.lua index 395059a..627703c 100644 --- a/acf2/transaction/init.lua +++ b/acf2/transaction/init.lua @@ -44,11 +44,12 @@ function Transaction:init(backend, validate) self.validate = validate self.validable = {} - self.commit_val = {} self.root = root.RootModel(self) end +function Transaction:committing() return self.commit_val and true or false end + function Transaction:check() if not self.backend then error('Transaction already committed') end end @@ -169,6 +170,7 @@ function Transaction:commit() end while next(self.commit_val) do validate(next(self.commit_val)) end + self.commit_val = nil errors:raise() end -- cgit v1.2.3