Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
17
research/chatwoot/app/drops/user_drop.rb
Normal file
17
research/chatwoot/app/drops/user_drop.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class UserDrop < BaseDrop
|
||||
def name
|
||||
@obj.try(:name).try(:split).try(:map, &:capitalize).try(:join, ' ')
|
||||
end
|
||||
|
||||
def available_name
|
||||
@obj.try(:available_name)
|
||||
end
|
||||
|
||||
def first_name
|
||||
@obj.try(:name).try(:split).try(:first).try(:capitalize) if @obj.try(:name).try(:split).try(:size) > 1
|
||||
end
|
||||
|
||||
def last_name
|
||||
@obj.try(:name).try(:split).try(:last).try(:capitalize) if @obj.try(:name).try(:split).try(:size) > 1
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user