I have a model find like this for an API:
Article.includes(:comments).all
When applying the to_json
method, I'd like to get back the article along with an array of the comments. Unfortunately, the to_json method only returns the Article model. Help.