From d8872bc785c9b99bb5373b34b556cd49d7fa9436 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Tue, 24 Nov 2020 11:37:43 +0100 Subject: [PATCH] Explain why Arel can't be used in statement --- app/services/customers_with_balance.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/customers_with_balance.rb b/app/services/customers_with_balance.rb index e34e37736f..13ab8d40a1 100644 --- a/app/services/customers_with_balance.rb +++ b/app/services/customers_with_balance.rb @@ -18,6 +18,8 @@ class CustomersWithBalance attr_reader :enterprise_id + # Arel doesn't support CASE statements until v7.1.0 so we'll have to wait with SQL literals + # a little longer. See https://github.com/rails/arel/pull/400 for details. def outstanding_balance <<-SQL.strip_heredoc SUM(