lib/ohm/lua/save.lua in ohm-3.0.0 vs lib/ohm/lua/save.lua in ohm-3.0.1
- old
+ new
@@ -76,12 +76,13 @@
end
local function unique(model, uniques)
for field, value in pairs(uniques) do
local key = model.name .. ":uniques:" .. field
+ local val = tostring(value)
- redis.call("HSET", model.key .. ":_uniques", key, value)
- redis.call("HSET", key, value, model.id)
+ redis.call("HSET", model.key .. ":_uniques", key, val)
+ redis.call("HSET", key, val, model.id)
end
end
local function remove_uniques(model)
local memo = model.key .. ":_uniques"