fix recent changes error (nil updated_at)

Ticket

fix recent changes error (nil updated_at)+status
fix recent changes error (nil updated_at)+priority
fix recent changes error (nil updated_at)+tag
fix recent changes error (nil updated_at)+commit
 

fix recent changes error (nil updated_at)+issues

 ActionView::TemplateError (undefined method `year' for nil:NilClass) on line #14 of block/_recent_changes.rhtml:
[12:50pm] ethn: 11:      #FIXME - tis UGLY, we're getting cached cards, so get the real card to call
[12:50pm] ethn: 12:      # revised_at on.  the cards should already be there from the search results.
[12:50pm] ethn: 13:      real_card = card.respond_to?(:card) ? card.card : card
[12:50pm] ethn: 14:    day = Date.new(real_card.updated_at.year, real_card.updated_at.month, real_card.updated_at.day)
[12:50pm] ethn: 15:    cards_by_day[day] << card
[12:50pm] ethn: 16:  end
[12:50pm] ethn: 17: %>

 

fix recent changes error (nil updated_at)+solution

This was caused by a data problem: cards with wrong key for their name. 

The problem is contained now- (error renders in content doesn't break whole page)

And we've added some data consistency checks (db constraints, validations) but don't know that they will prevent this from happening.