avoinministerio/avoinministerio — pull request #220 by jyrkive (2012-08-07 07:05:03+00:00)
Title: Attempted fix for a crash

In Pull Request #216 I introduced the Idea#updated_content_at attribute. It caused problems in staging. First, Aleksi reported the following crash:

> jyrki, viimeisestä deployauksesta stagingille tulee virheilmoitusta: NoMethodError (undefined method `mday' for "2012-07-16 10:23:46.825083":String)

Second, the database migration failed to update some records, likely because they didn't pass validation. Finally, the database migration changed every single idea, which also updated their updated_at timestamps.

This commit attempts to fix all these issues.

+ ApplicationHelper::finnishDate now detects if the passed time is a string and tries to parse it if necessary.
+ The database migration now skips validation when saving the records.
+ The database migration now disables timestamp recording before changing the ideas (and enables it afterwards).