From 9d2477e6f8472e8ea4523e90b1288208e2a9be4c Mon Sep 17 00:00:00 2001
From: Israel Barreto Sant'Anna <ibsantanna@inf.ufpr.br>
Date: Mon, 10 Sep 2018 10:27:37 -0300
Subject: [PATCH] Added belongs_to school in User

---
 app/models/user.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/models/user.rb b/app/models/user.rb
index 908a27b7..9d956338 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -70,6 +70,8 @@ class User < ApplicationRecord
 
   include DeviseTokenAuth::Concerns::User
 
+  belongs_to :school
+
   has_and_belongs_to_many :roles
   has_and_belongs_to_many :institutions
 
@@ -293,7 +295,7 @@ class User < ApplicationRecord
     return true if (changed & ["teacher_id", "birthday"]).empty?
 
     params = {
-      filter: "teacher:#{teacher_id},day: #{birthday.day},month:#{birthday.month},year:#{birthday.year},min_year:2017"   
+      filter: "teacher:#{teacher_id},day: #{birthday.day},month:#{birthday.month},year:#{birthday.year},min_year:2017"
     }
     uri = URI("https://simcaq.c3sl.ufpr.br/api/v1/verify_teacher")
     uri.query = URI.encode_www_form(params)
-- 
GitLab