From 676875914fb9f88af1a996ac4658df6104f97a84 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 17 Jan 2016 18:23:26 +0100 Subject: [PATCH] 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 2723cd6..9baf117 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)