rails/rails — pull request #6376 by jgaskins (2012-05-18 11:09:45+00:00)
Title: Increase numeric-timestamp precision to µseconds

The current implementation of numeric timestamps is to only include up
to the second. Unfortunately, when running tests, many things can (and
should) happen within a single second and precision of a full second
isn't enough. Milliseconds may be good here, but with fast-enough
CPUs, a single test example may execute within that one-millisecond
boundary, which may include multiple calls.

More importantly, in a production environment, precision of one second can
be far too much for cache invalidation (`AR::Base#cache_key` uses
`Time#to_s(:numeric)`), as when two clients update the same record
simultaneously, the first update will be cached. Since the second update
assigns the same value to `updated_at`, the first cached value is not
invalidated unless done so manually.