I’m using Single Table Inheritance (STI) in my Rails app for the User object. There is an API response that is including all attributes of my User subclasses (Teacher, Student) except for type
. I believe this is due to using the render json
method, as I was able to find some other questions from a long time ago with this issue, but haven’t found any solutions.
How do I prevent Rails from suppressing the user type attribute in the json response?