From d2a7f29595786376a3010cb7e320d66f5b8d60ef Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 14 Mar 2019 08:15:09 +0800 Subject: [PATCH] Revert "REFACTOR: remove unnecessary parentheses attempt 2 (follow-up on 154f503d)" This reverts commit 7db2dc717e672e831657183b3b069307aaa2a842. Commit breaks post edits for regular users. --- app/models/post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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