From e9ba4c74f7fc341826383c90c8ab371df42b422b Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 12 Mar 2019 15:00:58 -0400 Subject: [PATCH] Revert "REFACTOR: remove unnecessary parentheses" Specs fail --- 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 8020ddbb8f5..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