Modifying the Task Class

Great! We now have default tasks on all new events, users can add and remove tasks as needed, and tasks can be assigned to users. But there’s something missing....

Excuse us while we take off our customer hats and smack ourselves in the forehead.

We don’t have any way to mark a task as completed! Not to worry—we’ll just do a quick bit of reworking, and we’ll be good to go. First we’ll modify the Task class. Open TekDays/grails-app/domain/com/tekdays/Task.groovy, and add a new property and constraint, as shown here:

things.2/TekDays/grails-app/domain/com/tekdays/Task.groovy
 
package​ com.tekdays
 
 
class​ Task {
 
String​ title
 
String​ notes
 
TekUser assignedTo
 
Date​ dueDate
 
TekEvent event
*
Boolean​ completed ...

Get Grails 2: A Quick-Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.