Method: Connectwise::TicketNote.transform

Defined in:
lib/connectwise/ticket_note.rb

.transform(attrs) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/connectwise/ticket_note.rb', line 11

def self.transform(attrs)
  type = attrs.delete(:type)
  attrs[:note_text] ||= attrs.delete(:note)
  if type == :internal
    attrs[:is_part_of_internal_analysis] = true
  elsif type == :resolution
    attrs[:is_part_of_resolution] = true
  else
    attrs[:is_part_of_detail_description] = true
  end
  attrs
end