aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/collection_cache_key.rb
Commit message (Collapse)AuthorAgeFilesLines
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* Address ORA-00923 error by quoting a reserved word "SIZE"Yasuo Honda2016-04-161-1/+1
|
* Fix AR::Relation#cache_key to remove select scope added by userPrathamesh Sonpatki2016-01-241-0/+1
| | | | | | | | | | - We don't need the select scope added by user as we only want to max timestamp and size of the collection. So we already know which columns to select. - Additionally having user defined columns in select scope blows the cache_key method with PostGreSQL because it needs all `selected` columns in the group_by clause or aggregate function. - Fixes #23038.
* Fix ActiveRecord::Relation#cache_key for relations with no resultsPrathamesh Sonpatki2016-01-221-2/+8
| | | | | | | - When relations return no result or 0 result then cache_key should handle it gracefully instead of blowing up trying to access `result[:size]` and `result[:timestamp]`. - Fixes #23063.
* Fix ActiveRecord::Relation#cache_key for loaded empty collectionPrathamesh Sonpatki2016-01-161-1/+3
| | | | | | | | | - Before this patch if we try to find cache_key of a loaded but empty collection it used to give error because of trying to call `updated_at` on `nil` value generated by `collection.max_by(&timestamp_column).public_send(timestamp_column)`. - This commit fixes above error by checking if size is greater than zero or not.
* Fix test failures caused by #20884Sean Griffin2015-08-011-1/+3
| | | | | | | PostgreSQL is strict about the usage of `DISTINCT` and `ORDER BY`, which one of the tests demonstrated. The order clause is never going to be relevant in the query we're performing, so let's just remove it entirely.
* Add #cache_key to ActiveRecord::Relation.Alberto F. Capel2015-07-201-0/+29