trying to format the string. In the generate method, we already have logic to
return nil if the start date is not defined, so I added a check in the fetch
method to return nil if the generate method exited with a nil status.
@ -2,7 +2,7 @@ class BacklogChartData < ActiveRecord::Base
unloadable
set_table_name'backlog_chart_data'
belongs_to:backlog
defself.generate(backlog)
# do not generate if end_date or start_date are not defined
# or if the start date is still in the future
@ -14,7 +14,7 @@ class BacklogChartData < ActiveRecord::Base
scope=Item.sum('points',:conditions=>["items.backlog_id=? AND items.parent_id=0",backlog.id])
done=Item.sum('points',:include=>{:issue=>:status},:conditions=>["items.parent_id=0 AND items.backlog_id=? AND issue_statuses.is_closed=?",backlog.id,true])
data=find_all_by_backlog_idbacklog.id,:conditions=>["created_at>=? AND created_at<=?",backlog.start_date.to_formatted_s(:db),end_date.to_formatted_s(:db)],:order=>"created_at ASC"