Can anyone offer some advice as to what the "best" way to include nested objects/relations in a JSON response that you want to filter?
In the simple example below, say the model Comment has a soft delete flag is_deleted = true, I want to only include comments that have is_deleted = false. What's the best way to accomplish this?
posts = Post.all
render json: posts.to_json(:include => [:comments])