From 0fd3bd944a037f0eecf2731c617e5b116ca5554d Mon Sep 17 00:00:00 2001 From: Christopher Vollick <0@psycoti.ca> Date: Thu, 24 Mar 2022 14:17:11 -0400 Subject: [PATCH] Order Transactions by Date In my testing the natural order just happened to be the date order because I had so little data. But in the real world we should probably be more explicit! --- lib/customer_finacials.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/customer_finacials.rb b/lib/customer_finacials.rb index fd1ad66bccd0e23599882648efe00c4cb48a2fb6..9841c501b2a82254bf45024984eda425ad7ca84a 100644 --- a/lib/customer_finacials.rb +++ b/lib/customer_finacials.rb @@ -59,7 +59,9 @@ class CustomerFinancials created_at, amount, note - FROM transactions WHERE customer_id = $1; + FROM transactions + WHERE customer_id = $1 + ORDER BY created_at; SQL def transactions