Commit 0c25e774 authored by François Perrad's avatar François Perrad

create could return an array

parent ca570cec
......@@ -145,9 +145,11 @@ end
function create (class, val)
if type(val) == 'table' and #val > 0 then
local t = {}
for i = 1, #val do
create(class, val[i])
t[#t+1] = create(class, val[i])
end
return t
else
local obj = class.new(val)
obj:save()
......
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