aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-06-17 21:49:28 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-06-17 22:14:29 +0900
commitcb0299c9eba6463085130debda6347abf9683463 (patch)
treeea35f99ba81e22ff028c047d65907fdbc0122ab2 /activerecord/test/schema
parentb6068e6c42a070843b0a3844dc72c2a98ec3c6eb (diff)
downloadrails-cb0299c9eba6463085130debda6347abf9683463.tar.gz
rails-cb0299c9eba6463085130debda6347abf9683463.tar.bz2
rails-cb0299c9eba6463085130debda6347abf9683463.zip
PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute
GROUP BY with virtual count attribute is invalid for almost all databases, but it is valid for PostgreSQL, and it had worked until Rails 5.2.2, so it is a regression for Rails 5.2.3 (caused by 311f001). I can't find perfectly solution for fixing this for now, but I would not like to break existing apps, so I decided to allow referencing virtual count attribute in ORDER BY clause when GROUP BY aggrigation (it partly revert the effect of 311f001) to fix the regression #36022. Fixes #36022.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 41920b3719..eed18a7b89 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -261,6 +261,7 @@ ActiveRecord::Schema.define do
t.references :developer, index: false
t.references :company, index: false
t.string :metadata
+ t.integer :count
end
create_table :customers, force: true do |t|