mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 02:11:01 +08:00

Since we recently blocked accidental serialization of AR models, we are getting a 500 error in some cases with thumbnails. We can fix this by serializing the thumbnail, previously we just returned a raw OptimizedImage object. Thumbnails are now attached to the serializer in core, therefore we no longer need to use add_to_serializer within the chat plugin to use thumbnails within chat message uploads.
6 lines
166 B
Ruby
6 lines
166 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UploadThumbnailSerializer < ApplicationSerializer
|
|
attributes :id, :upload_id, :width, :height, :url, :extension, :filesize
|
|
end
|