Ignore:
Timestamp:
Jan 26, 2011, 3:29:08 AM (14 years ago)
Author:
gav
Message:

Domain change, adjust TaskProcedure to Task relationship.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/features/taskProcedureRework/grails-app/controllers/TaskProcedureDetailedController.groovy

    r403 r758  
    5050        if(taskProcedureInstance) {
    5151            try {
     52                taskProcedureInstance.tasks.each {
     53                    it.taskProcedure = null
     54                }
    5255                taskProcedureInstance.delete(flush:true)
    5356                flash.message = "TaskProcedure ${params.id} deleted"
     
    125128    def save = {
    126129        def taskProcedureInstance = new TaskProcedure(params)
    127         def taskInstance = Task.get(params.taskInstance.id)
     130        def taskInstance = Task.get(params.parentTask.id)
    128131
    129132        if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) {
    130             taskProcedureInstance.addToTasks(taskInstance)
     133            taskProcedureInstance.addToTasks(taskInstance) // also sets: taskInstance.taskProcedure = taskProcedureInstance
    131134            flash.message = "TaskProcedure ${taskProcedureInstance.id} created."
    132135            redirect(action:show,id:taskProcedureInstance.id)
Note: See TracChangeset for help on using the changeset viewer.