chore: Auto capitalize the name field while sending the canned response/variables (#6758)
* capitalize name before sending the message * Fix specs * Code cleanups
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
class ContactDrop < BaseDrop
|
||||
def name
|
||||
@obj.try(:name).try(:capitalize)
|
||||
end
|
||||
|
||||
def email
|
||||
@obj.try(:email)
|
||||
end
|
||||
@@ -8,7 +12,7 @@ class ContactDrop < BaseDrop
|
||||
end
|
||||
|
||||
def first_name
|
||||
@obj.try(:name).try(:split).try(:first)
|
||||
@obj.try(:name).try(:split).try(:first).try(:capitalize) if @obj.try(:name).try(:split).try(:size) > 1
|
||||
end
|
||||
|
||||
def last_name
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
class UserDrop < BaseDrop
|
||||
def name
|
||||
@obj.try(:name).try(:capitalize)
|
||||
end
|
||||
|
||||
def available_name
|
||||
@obj.try(:available_name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user