updated_on is nil if there's no story

pull/6827/head
friflaj 14 years ago
parent 58cb85fa91
commit 3ad742ce26
  1. 5
      app/controllers/rb_master_backlogs_controller.rb

@ -7,11 +7,12 @@ class RbMasterBacklogsController < RbApplicationController
product_backlog_stories = Story.product_backlog(@project)
sprints = Sprint.open_sprints(@project)
@last_update = Story.find(
last_story = Story.find(
:first,
:conditions => ["project_id=? AND tracker_id in (?)", @project, Story.trackers],
:order => "updated_on DESC"
).updated_on
)
@last_update = (last_story ? last_story.updated_on : nil)
@product_backlog = { :sprint => nil, :stories => product_backlog_stories }
@sprint_backlogs = sprints.map{ |s| { :sprint => s, :stories => s.stories } }

Loading…
Cancel
Save