mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
a previous commit introduced a bug where hiding a project did not hide the todos in it. Fixes #832
This commit is contained in:
parent
8076f4fe72
commit
07426ebe54
5 changed files with 25 additions and 31 deletions
|
|
@ -106,9 +106,9 @@ class ProjectsController < ApplicationController
|
|||
def update
|
||||
params['project'] ||= {}
|
||||
if params['project']['state']
|
||||
@state_changed = @project.state != params['project']['state']
|
||||
@new_state = params['project']['state']
|
||||
@state_changed = @project.state != @new_state
|
||||
logger.info "@state_changed: #{@project.state} == #{params['project']['state']} != #{@state_changed}"
|
||||
@project.transition_to(params['project']['state'])
|
||||
params['project'].delete('state')
|
||||
end
|
||||
success_text = if params['field'] == 'name' && params['value']
|
||||
|
|
@ -117,6 +117,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
@project.attributes = params['project']
|
||||
if @project.save
|
||||
@project.transition_to(@new_state) if @state_changed
|
||||
if boolean_param('wants_render')
|
||||
if (@project.hidden?)
|
||||
@project_project_hidden_todo_counts = Hash.new
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue