mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
optimize for the common case: selecting only one tag
This commit is contained in:
parent
58d8bc56d1
commit
bfb6c4ee9a
1 changed files with 3 additions and 0 deletions
|
|
@ -1028,6 +1028,9 @@ class TodosController < ApplicationController
|
|||
end
|
||||
|
||||
def find_todos_with_tag_expr(tag_expr)
|
||||
# optimize for the common case: selecting only one tag
|
||||
return current_user.todos.with_tag(@tag_name) if @single_tag
|
||||
|
||||
tag_ids = get_ids_from_tag_expr(tag_expr)
|
||||
todos = current_user.todos
|
||||
tag_ids.each do |ids|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue