Hi ElMassimo, thanks for your work, amazing and fast lib!
I have a few questions:
- How do I make fields in the serializer that are always obtained by querying a value rather than a cached version of the value?
class MixSerializer < Oj::Serializer
has_one :user, serializer: UserListItemSerializer
attributes :id,
:field_that_never_been_cached,
:title
attribute \
def field_that_never_been_cached
get_updated_data
end
end
- How to pass additional data to the serializer besides the serialization object itself? For example current_user object from Devise
render json: AlbumSerializer.one(album, current_user: current_user) if signed_in?
Thanks!
Hi ElMassimo, thanks for your work, amazing and fast lib!
I have a few questions:
Thanks!