Fix the tag-specific listing to fetch the user's specific tag instead of the first one in a multi-user environment.

This commit is contained in:
Jyri-Petteri Paloposki 2020-12-11 17:55:54 +02:00
parent 75e5c98ce6
commit 03ab384b9c

View file

@ -907,7 +907,7 @@ end
def find_todos_with_tag_expr(tag_expr)
# optimize for the common case: selecting only one tag
if @single_tag
tag = Tag.where(:name => @tag_name).first
tag = current_user.tags.where(:name => @tag_name).first
tag_id = tag.nil? ? -1 : tag.id
return current_user.todos.with_tag(tag_id)
end