This repository was created to demonstrate the problem that this Pull-Request aims to fix: rails-api/active_model_serializers#2331
It replicates the issue I was having in my application.
Run rspec with the unpatched and patched versions of active_model_serializers, see the Gemfile.