You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a quick note that the workarounds above do not seem to work since the argument that is passed to the proc is a serializer instance, not the attribute (resulting in undefined method 'iso8601' for #<FooSerializer:0x000000051ea2a8).
Here's what I ended up using for date attributes:
classBaseSerializerincludeJSONAPI::Serializerdefself.date_attribute(name)attribute(name)dovalue=object.public_send(name)value.respond_to?(:iso8601) ? value.iso8601 : valueendendendclassFooSerializer < BaseSerializerdate_attribute:created_at# other attributes...end
example:
The text was updated successfully, but these errors were encountered: