Commit caaae49f authored by François Perrad's avatar François Perrad

fix save when update

parent 79a2a3d1
......@@ -114,7 +114,8 @@ function save (class, obj)
end
if rawget(obj, '_db_exist') then
execute(class, dado.update(class._TABLE_NAME, values))
local cond = dado.AND { [primary_key] = obj[primary_key] }
execute(class, dado.update(class._TABLE_NAME, values, cond))
else
obj[primary_key] = next_id(class)
values[primary_key] = obj[primary_key]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment