mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
fix cache invariant for grouped todos in context and project view
This commit is contained in:
parent
1ae6e13f1d
commit
f4908f2b7b
3 changed files with 6 additions and 2 deletions
|
|
@ -294,5 +294,9 @@ module ApplicationHelper
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def source_view_key
|
||||||
|
# uses @project.id or @context.id depending on source_view
|
||||||
|
source_view_is_one_of(:project, :context) ? "#{@source_view}-#{eval("@#{@source_view}.id")}" : @source_view
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
@not_done = @not_done_todos.select {|t| t.context_id == context.id }
|
@not_done = @not_done_todos.select {|t| t.context_id == context.id }
|
||||||
# invalidate the cache every day because of staleness or
|
# invalidate the cache every day because of staleness or
|
||||||
# rendering of "due in x days" that change without touching updated at of the todo
|
# rendering of "due in x days" that change without touching updated at of the todo
|
||||||
cache [context, @source_view, current_user.date.strftime("%Y%m%d"), @tag_name] do
|
cache [context, source_view_key, current_user.date.strftime("%Y%m%d"), @tag_name] do
|
||||||
-%>
|
-%>
|
||||||
<%=
|
<%=
|
||||||
render :partial => 'todos/collection',
|
render :partial => 'todos/collection',
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
@not_done = @not_done_todos.select {|t| t.project_id == project.id }
|
@not_done = @not_done_todos.select {|t| t.project_id == project.id }
|
||||||
# invalidate the cache every day because of staleness or
|
# invalidate the cache every day because of staleness or
|
||||||
# rendering of "due in x days" that change without touching updated at of the todo
|
# rendering of "due in x days" that change without touching updated at of the todo
|
||||||
cache [project, @source_view, current_user.date.strftime("%Y%m%d"), @tag_name] do
|
cache [project, source_view_key, current_user.date.strftime("%Y%m%d"), @tag_name] do
|
||||||
-%>
|
-%>
|
||||||
<%=
|
<%=
|
||||||
title = source_view_is(:project) ? t('projects.actions_in_project_title') : show_project_name(project)
|
title = source_view_is(:project) ? t('projects.actions_in_project_title') : show_project_name(project)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue