From 638de59cd6b833a4197827a48545aa904a0850ad Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Wed, 30 Jan 2019 14:14:11 -0600 Subject: [PATCH] Exporting names now works correctly if there's a space in the end of a name --- lib/query/query_supporters.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/query/query_supporters.rb b/lib/query/query_supporters.rb index a0f9f5b0..771a8ea4 100644 --- a/lib/query/query_supporters.rb +++ b/lib/query/query_supporters.rb @@ -426,9 +426,9 @@ UNION DISTINCT def self.supporter_export_selections [ - "substring(supporters.name from '^.+ ([^\s]+)$') AS \"Last Name\"", - "substring(supporters.name from '^(.+) [^\s]+$') AS \"First Name\"", - "supporters.name AS \"Full Name\"", + "substring(trim(both from supporters.name) from '^.+ ([^\s]+)$') AS \"Last Name\"", + "substring(trim(both from supporters.name) from '^(.+) [^\s]+$') AS \"First Name\"", + "trim(both from supporters.name) AS \"Full Name\"", "supporters.organization AS \"Organization\"", "supporters.email \"Email\"", "supporters.phone \"Phone\"",