From ea027656b7b103f30c25c555e499414fe9dbdd89 Mon Sep 17 00:00:00 2001 From: Jan Renz Date: Tue, 28 Apr 2015 14:20:21 +0200 Subject: [PATCH] Nicer fetch of empty relations --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index b187881d..7076ca81 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -39,7 +39,7 @@ class CommentsController < ApplicationController #add names to comments @comments.map{|comment| comment.username = Xikolo::UserClient.get(comment.user_id.to_s)[:display_name]} else - @comments = Comment.where(file_id: -1) #we need an empty relation here + @comments = Comment.all.limit(0) #we need an empty relation here end authorize! end