Plugin working locally But not in live

I just spent a long time debugging an issue caused by this. I was doing

add_to_serializer(:admin_user, :somefield)...

which worked fine in development, but not in production. Changing it to :admin_detailed_user fixed the problem (admin_detailed_user inherits from admin_user).

It would be good if we can either fix this, or at least add a warning. Differences between dev/prod are painful!