Files
leadchat/app/drops/user_drop.rb
Muhsin Keloth 5b7bed9640 chore: Auto capitalize the name field while sending the canned response/variables (#6758)
* capitalize name before sending the message

* Fix specs

* Code cleanups
2023-03-27 18:49:48 +05:30

18 lines
322 B
Ruby

class UserDrop < BaseDrop
def name
@obj.try(:name).try(:capitalize)
end
def available_name
@obj.try(:available_name)
end
def first_name
@obj.try(:name).try(:split).try(:first)
end
def last_name
@obj.try(:name).try(:split).try(:last) if @obj.try(:name).try(:split).try(:size) > 1
end
end