webmcp
changeset 437:b4aac2bdc33d
Make <db_object>:try_save() work properly with "document_column" being set (by using "_col" proxy)
author | jbe |
---|---|
date | Wed Jan 20 20:53:19 2016 +0100 (2016-01-20) |
parents | 1dbbe4c62f08 |
children | ea8419658535 |
files | libraries/mondelefant/mondelefant.lua |
line diff
1.1 --- a/libraries/mondelefant/mondelefant.lua Wed Jan 20 20:43:23 2016 +0100 1.2 +++ b/libraries/mondelefant/mondelefant.lua Wed Jan 20 20:53:19 2016 +0100 1.3 @@ -1122,7 +1122,7 @@ 1.4 local values = {sep = ", "} 1.5 for key in pairs(self._dirty or {}) do 1.6 add(fields, {'"$"', {key}}) 1.7 - add(values, {'?', self[key]}) 1.8 + add(values, {'?', self._col[key]}) 1.9 end 1.10 local db_error, db_result 1.11 if #fields == 0 then 1.12 @@ -1163,10 +1163,10 @@ 1.13 if 1.14 mutability_state == true or ( 1.15 verify_mutability_state and 1.16 - verify_mutability_state(self[key], mutability_state) 1.17 + verify_mutability_state(self._col[key], mutability_state) 1.18 ) 1.19 then 1.20 - add(command_sets, {'"$" = ?', {key}, self[key]}) 1.21 + add(command_sets, {'"$" = ?', {key}, self._col[key]}) 1.22 self._dirty[key] = true -- always dirty in case of later error 1.23 end 1.24 end 1.25 @@ -1201,7 +1201,7 @@ 1.26 for key in pairs(self._dirty or {}) do 1.27 if save_mutability_state then 1.28 self._dirty[key] = 1.29 - save_mutability_state and save_mutability_state(self[key]) or nil 1.30 + save_mutability_state and save_mutability_state(self._col[key]) or nil 1.31 end 1.32 end 1.33 return nil