add first name var

This commit is contained in:
Pete Matsyburka
2024-09-01 20:38:49 +03:00
parent a04c04141c
commit b16322dd5b
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -85,6 +85,14 @@ class Submitter < ApplicationRecord
end
end
def first_name
name.split(/\s+/, 2).first
end
def last_name
name.split(/\s+/, 2).last
end
def status_event_at
declined_at || completed_at || opened_at || sent_at || created_at
end