The `before_type_cast` method sometimes returns a string for `message_type`, creating inconsistencies in different payloads. This pull request will remove all `before_type_cast` usage and replace it with `to_i` methods.
10 lines
439 B
Ruby
10 lines
439 B
Ruby
json.id resource.id
|
|
json.content resource.content
|
|
json.message_type resource.message_type.to_i
|
|
json.content_type resource.content_type
|
|
json.content_attributes resource.content_attributes
|
|
json.created_at resource.created_at.to_i
|
|
json.conversation_id resource.conversation.display_id
|
|
json.attachments resource.attachments.map(&:push_event_data) if resource.attachments.present?
|
|
json.sender resource.sender.push_event_data if resource.sender
|