From 80d9a1761a104e43c8af02f5d979c0148ee337ff Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 17 Jan 2016 18:33:17 +0100 Subject: [PATCH] *actually* fix parens checking if forum exists this led to 500 when the forum was deleted but the thread still existed --- app/models/forumthread.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/forumthread.rb b/app/models/forumthread.rb index 9baf117..892ef15 100644 --- a/app/models/forumthread.rb +++ b/app/models/forumthread.rb @@ -38,7 +38,7 @@ class Forumthread < ActiveRecord::Base def can_read?(user) # we might have threads without a forum # e.g. forum deleted - forum && (forum.can_read?(user) || (forum.can_write?(user)) && self.sticky?) || author == user + forum && (forum.can_read?(user) || (forum.can_write?(user) && self.sticky?) || author == user) end def can_write?(user)