diff options
author | jomo <github@jomo.tv> | 2016-01-17 18:33:17 +0100 |
---|---|---|
committer | jomo <github@jomo.tv> | 2016-01-17 18:33:17 +0100 |
commit | 80d9a1761a104e43c8af02f5d979c0148ee337ff (patch) | |
tree | 87733c658bde70f50ae7bc27c18faf8d9f6d1ce2 | |
parent | 676875914fb9f88af1a996ac4658df6104f97a84 (diff) |
*actually* 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.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |