Commit 4778df1c authored by Robert Speicher's avatar Robert Speicher Committed by Robert Speicher

Merge branch 'mark-done-todo-id' into 'master'

Correctly return todo ID after creating todo

See merge request !4941
(cherry picked from commit 21842cf9)
parent 53452ef5
...@@ -159,8 +159,9 @@ class TodoService ...@@ -159,8 +159,9 @@ class TodoService
def create_todos(users, attributes) def create_todos(users, attributes)
Array(users).map do |user| Array(users).map do |user|
next if pending_todos(user, attributes).exists? next if pending_todos(user, attributes).exists?
Todo.create(attributes.merge(user_id: user.id)) todo = Todo.create(attributes.merge(user_id: user.id))
user.update_todos_count_cache user.update_todos_count_cache
todo
end end
end end
......
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