Skip to content

Commit

Permalink
Fix syntax error in grouped notifications CTE on some PostgreSQL vers…
Browse files Browse the repository at this point in the history
…ions (mastodon#31098)
  • Loading branch information
ClearlyClaire authored Jul 22, 2024
1 parent 4f55be2 commit 98306e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def paginate_groups_by_max_id(limit, max_id: nil, since_id: nil)
.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')
Expand Down Expand Up @@ -177,7 +177,7 @@ def paginate_groups_by_min_id(limit, max_id: nil, min_id: nil)
.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')
Expand Down

0 comments on commit 98306e2

Please # to comment.