fix recent changes error (nil updated_at)
Ticket
+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: %>
+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.