From 167bcccc0159b8efec1d361694dc6b0123e98c9c Mon Sep 17 00:00:00 2001
From: "Douglas A. C" <dac17@inf.ufpr.br>
Date: Mon, 11 Mar 2019 11:45:05 -0300
Subject: [PATCH] Passing "complaint_reason" alongside to the complaint in
 "show_related" request.

---
 app/controllers/v1/complaints_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/controllers/v1/complaints_controller.rb b/app/controllers/v1/complaints_controller.rb
index 8d374be4..e5f3b460 100644
--- a/app/controllers/v1/complaints_controller.rb
+++ b/app/controllers/v1/complaints_controller.rb
@@ -42,7 +42,7 @@ class V1::ComplaintsController < ApplicationController
   # GET /v1/complaints/1/show_related.json
   def show_related
     response = Complaint.where(complainable: @complaint.complainable, state: "complained")
-    render status: :ok, json: response
+    render status: :ok, json: response , :include => {:complaint_reason => {:except => [:updated_at, :created_at]}}
   end
 
   
-- 
GitLab