*actually* fix parens checking if forum exists

this led to 500 when the forum was deleted but the thread still existed
This commit is contained in:
jomo
2016-01-17 18:33:17 +01:00
parent 676875914f
commit 80d9a1761a

View File

@@ -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)