rails/rails — pull request #5844 by assembler (2012-04-14 10:25:15+00:00)
Title: Activerecord cache key as timestamp

Cache key for ActiveRecord model is calculated using `to_s(:number)` method on `updated_at` timestamp.

This approach rounds the `cache_key` to whole number of seconds. If record is changed twice within a second, later change wont change the `cache_key`, which leads to inconsistent state.

Common example would be user accidentally clicking twice on an ajaxified link with some kind of toggle behavior. Even though it will toggle it twice, cache will change only once.

I changed the `cache_key` to include float timestamp rather than :number representation of time.