Open kpheasey opened 5 years ago
Solution was to use a custom attribute convert the uploader to json.
# app.serializers/user_serializer.rb
class UserSerializer
include FastJsonapi::ObjectSerializer
set_type :users
cache_options enabled: true
attributes :id
attributes :avatar do |object|
object.avatar.as_json
end
end
When caching is enabled on a serializer that has an attribute defined for a Carrierwave Uploader, a
TypeError: no _dump_data is defined for class Proc
is thrown.Here's the trace: