Skip to content

A platform for community discussion. Free, open, simple.

Revert "REFACTOR: remove unnecessary parentheses attempt 2 (follow-up on 154f503d)"

Guo Xiang Tand2a7f2959578
diff --git a/app/models/post.rb b/app/models/post.rb
index 0441bcb3273..8e03538f527 100644
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -215,7 +215,8 @@ class Post < ActiveRecord::Base
end
def matches_recent_post?
- $redis.get(unique_post_key)&.to_i != id
+ post_id = $redis.get(unique_post_key)
+ post_id != (nil) && post_id.to_i != (id)
end
def raw_hash