From 87e816ba42d05efe49447917a051cd66c5347fcc Mon Sep 17 00:00:00 2001 From: Mateus Rambo Strey <mars11@inf.ufpr.br> Date: Wed, 23 Nov 2016 10:26:08 -0200 Subject: [PATCH] style user model --- app/models/user.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 372c5e3bf..c07fd326a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -104,18 +104,14 @@ class User < ApplicationRecord lo end - def own_reviews - reviews = Review.where(user_id: id) + Review.where(user_id: id) end def received_reviews - - #reviews = LearningObject.joins(:reviews).where(publisher_id: id) - - reviews = Review.joins("INNER JOIN learning_objects ON " + - "learning_objects.publisher_id = #{id} AND " + - "reviews.reviewable_id = learning_objects.id") + Review.joins('INNER JOIN learning_objects ON ' \ + "learning_objects.publisher_id = #{id} AND " \ + 'reviews.reviewable_id = learning_objects.id') end # ~~~~ followable actions ~~~~ # -- GitLab