aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/collection_cache_key_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* fixes #21815Maarten Jacobs2015-10-161-1/+1
| | | | | | | | | | | | | | | The default timestamp used for AR is `updated_at` in nanoseconds! (:nsec) This causes issues on any machine that runs an OS that supports nanoseconds timestamps, i.e. not-OS X, where the cache_key of the record persisted in the database (milliseconds precision) is out-of-sync with the cache_key in the ruby VM. This commit adds: A test that shows the issue, it can be found in the separate file `cache_key_test.rb`, because - model couldn't be defined inline - transactional testing needed to be turned off to get it to pass the MySQL tests This seemed cleaner than putting it in an existing testcase file. It adds :usec as a dateformat that calculates datetime in microseconds It sets precision of cache_key to :usec instead of :nsec, as no db supports nsec precision on timestamps
* Fix ambiguous argument warningMehmet Emin İNAÇ2015-08-021-1/+1
| | | | encapsulate all arguments
* Add #cache_key to ActiveRecord::Relation.Alberto F. Capel2015-07-201-0/+70