redding/mr — pull request #175 by jcredding (2014-01-28 16:48:10+00:00)
Title: Speed up random date and time generation with `MR::Factory`

This makes some changes to the `MR::Factory` date and time
generation to speed up creating random values. We switched this to
always return random dates so that it behaved like other values
generated by `Factory` and to avoid "magic-values" in tests.
Unfortunately, this caused significant slowdown in large test
suites. The major slowdown was ActiveRecord type casting the
date/time strings. This changes the generation to 'cache' the
ActiveRecord date/time and then add a random amount of days.
This achieves random dates and times without the problematic
slowdown.

@kellyredding - The 'significant slowdown' in our large app was about 8s for me. I was playing around with changes to speed it up but keep the random dates and came up with this.