fix updating dependency trees when changin a name. Including invalidating cache when

necessary
This commit is contained in:
Reinier Balt 2013-02-17 17:37:15 +01:00
parent 1d359b22d4
commit 1a82f68d4b
5 changed files with 23 additions and 14 deletions

View file

@ -470,7 +470,7 @@ class TodosController < ApplicationController
def update
@todo = current_user.todos.find_by_id(params['id'])
@source_view = params['_source_view'] || 'todo'
init_data_for_sidebar unless mobile?
# init_data_for_sidebar unless mobile?
cache_attributes_from_before_update
@ -497,6 +497,8 @@ class TodosController < ApplicationController
determine_down_count
determine_deferred_tag_count(params['_tag_name']) if source_view_is(:tag)
@todo.touch_predecessors if @original_item_description != @todo.description
respond_to do |format|
format.js {
@status_message = @todo.deferred? ? t('todos.action_saved_to_tickler') : t('todos.action_saved')
@ -1196,6 +1198,7 @@ class TodosController < ApplicationController
@original_item_due = @todo.due
@original_item_due_id = get_due_id_for_calendar(@todo.due)
@original_item_predecessor_list = @todo.predecessors.map{|t| t.specification}.join(', ')
@original_item_description = @todo.description
@todo_was_deferred_or_blocked = @todo.deferred? || @todo.pending?
end