Revert "REFACTOR: remove unnecessary parentheses"

Revert “REFACTOR: remove unnecessary parentheses”

Specs fail

diff --git a/app/models/post.rb b/app/models/post.rb
index 8020ddb..8e03538 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

GitHub sha: e9ba4c74

1 Like