mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-06 09:18:50 +01:00
parent
b89062913f
commit
b3059cf53a
3 changed files with 11 additions and 4 deletions
|
|
@ -1,7 +1,9 @@
|
|||
class Dependency < ActiveRecord::Base
|
||||
|
||||
belongs_to :predecessor, :foreign_key => 'predecessor_id', :class_name => 'Todo'
|
||||
belongs_to :successor, :foreign_key => 'successor_id', :class_name => 'Todo'
|
||||
# touch to make sure todo caches for predecessor and successor are invalidated
|
||||
|
||||
belongs_to :predecessor, :foreign_key => 'predecessor_id', :class_name => 'Todo', :touch => true
|
||||
belongs_to :successor, :foreign_key => 'successor_id', :class_name => 'Todo', :touch => true
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<%
|
||||
@not_done = @not_done_todos.select {|t| t.context_id == context.id }
|
||||
cache [context, @source_view] do
|
||||
# invalidate the cache every day because of staleness or
|
||||
# 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")] do
|
||||
%>
|
||||
<div id="c<%= context.id %>" class="container context" style="display:<%= (collapsible && @not_done.empty?) ? "none" : "block" %>">
|
||||
<h2>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<% cache project do %>
|
||||
<%
|
||||
# invalidate the cache every day because of staleness or
|
||||
# rendering of "due in x days" that change without touching updated at of the todo
|
||||
cache [project, current_user.date.strftime("%Y%m%d")] do %>
|
||||
<div class="container">
|
||||
<h2 id="project_name_container">
|
||||
<% if collapsible -%>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue