Allow editing recurring task groups, basic functionality for #152
This commit is contained in:
parent
17cbc57850
commit
fd51b07e21
3 changed files with 17 additions and 1 deletions
|
|
@ -42,9 +42,11 @@ class TasksController < ApplicationController
|
|||
|
||||
def update
|
||||
@task = Task.find(params[:id])
|
||||
task_group = @task.periodic_task_group
|
||||
was_periodic = @task.periodic?
|
||||
@task.attributes=(params[:task])
|
||||
if @task.errors.empty? && @task.save
|
||||
task_group.update_tasks_including(@task) if params[:periodic]
|
||||
flash[:notice] = I18n.t('tasks.update.notice')
|
||||
if was_periodic && !@task.periodic?
|
||||
flash[:notice] = I18n.t('tasks.update.notice_converted')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue