From fa2c61fc636f958c274692f2a0f3062859797790 Mon Sep 17 00:00:00 2001 From: jvillarejo Date: Thu, 21 Feb 2019 17:55:21 -0300 Subject: fixes different `count` calculation when using `size` manual `select` with DISTINCT When using `select` with `'DISTINCT( ... )'` if you use method `size` on a non loaded relation it overrides the column selected by passing `:all` so it returns different value than count. This fixes #35214 --- activerecord/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 77cb167e7c..c8fa387b42 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,9 @@ +* Fix different `count` calculation when using `size` with manual `select` with DISTINCT. + + Fixes #35214. + + *Juani Villarejo* + ## Rails 6.0.0.beta2 (February 25, 2019) ## * Fix prepared statements caching to be enabled even when query caching is enabled. -- cgit v1.2.3