summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2016-01-17 18:23:26 +0100
committerjomo <github@jomo.tv>2016-01-17 18:23:26 +0100
commit676875914fb9f88af1a996ac4658df6104f97a84 (patch)
treef50560da37c7d641fb1b82a72bc7a96c7a1f6e9d
parent7744703eb80a7e43bb9a46ba7eeb761952911cd6 (diff)
fix parens checking if forum exists
this led to 500 when the forum was deleted but the thread still existed
-rw-r--r--app/models/forumthread.rb2
1 files changed, 1 insertions, 1 deletions
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)