Permalink
Browse files

added some code to check data display

  • Loading branch information...
1 parent aa78231 commit ef3325ff6c14e89bd5d324295534fb3ce3f2a3cd @apollotech apollotech committed Jan 30, 2012
Showing with 8 additions and 8 deletions.
  1. +3 −3 grails-app/domain/timelog/Story.groovy
  2. +5 −5 grails-app/views/project/show.gsp
View
6 grails-app/domain/timelog/Story.groovy
@@ -49,20 +49,20 @@ class Story {
def completedTasks(){
return tasks.findAll{t->
- t.status == 'Completed'
+ ((t != null) && (t?.status == 'Completed'))
}
}
def unestimatedTasks(){
return tasks.findAll{t->
- t.estimate == null
+ t?.estimate == null
}
}
def workedOnBy(){
def workers = [] as Set
tasks.each{ t->
- t.timeEntries.each{e->
+ t?.timeEntries.each{e->
workers.add(e.createdBy.split('@')[0])
}
}
View
10 grails-app/views/project/show.gsp
@@ -146,16 +146,16 @@
<tbody>
<g:each in="${s.tasks}" var="t" status="i">
<tr>
- <td>${t.description}</td>
- <td>${t.status}</td>
- <td style="text-align:center;">${t.estimate}</td>
- <td style="text-align:center;">${t.actualHours()}</td>
+ <td>${t?.description}</td>
+ <td>${t?.status}</td>
+ <td style="text-align:center;">${t?.estimate}</td>
+ <td style="text-align:center;">${t?.actualHours()}</td>
<td>
<g:link controller="task" action="edit"
id="${t?.id}" class="mini btn">
Edit
</g:link>
- <g:if test="${t.status in ['Pending','Incomplete']}">
+ <g:if test="${t?.status in ['Pending','Incomplete']}">
<g:link controller="task" action="addEntry"
params="${[task_id:t?.id]}"
class="mini btn success">

0 comments on commit ef3325f

Please sign in to comment.