diff options
author | jomo <github@jomo.tv> | 2016-01-17 18:23:26 +0100 |
---|---|---|
committer | jomo <github@jomo.tv> | 2016-01-17 18:23:26 +0100 |
commit | 676875914fb9f88af1a996ac4658df6104f97a84 (patch) | |
tree | f50560da37c7d641fb1b82a72bc7a96c7a1f6e9d | |
parent | 7744703eb80a7e43bb9a46ba7eeb761952911cd6 (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.rb | 2 |
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) |