From 2774980589fd5d95a2a812527c269a4368e6889e Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 22 Jul 2024 09:37:27 +0200 Subject: [PATCH] Fix syntax error in grouped notifications CTE on some PostgreSQL versions (#31098) --- app/models/notification.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index 6d4041147..8b77b2a03 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -149,7 +149,7 @@ class Notification < ApplicationRecord .with_recursive( grouped_notifications: [ query - .select('notifications.*', "ARRAY[COALESCE(notifications.group_key, 'ungrouped-' || notifications.id)] groups") + .select('notifications.*', "ARRAY[COALESCE(notifications.group_key, 'ungrouped-' || notifications.id)] AS groups") .limit(1), query .joins('CROSS JOIN grouped_notifications') @@ -177,7 +177,7 @@ class Notification < ApplicationRecord .with_recursive( grouped_notifications: [ query - .select('notifications.*', "ARRAY[COALESCE(notifications.group_key, 'ungrouped-' || notifications.id)] groups") + .select('notifications.*', "ARRAY[COALESCE(notifications.group_key, 'ungrouped-' || notifications.id)] AS groups") .limit(1), query .joins('CROSS JOIN grouped_notifications')