If I want to maintain that method, it's easy.
I take their code: https://github.com/rails/docrails/blob/master/activemodel/lib/active_model/serialization.rb#L97-L121

and change that line: https://github.com/rails/docrails/blob/master/activemodel/lib/active_model/serialization.rb#L100
so that it reads `attribute_names = self.class.fields.keys`.

I do not own that code.