diff app/models/tweet.rb @ 163:ed73d92c7113

Whoops no id_str and wrong logic
author nanaya <me@nanaya.pro>
date Fri, 03 Aug 2018 02:12:41 +0900
parents c2e9d3a36bde
children 5af9b537db86
line wrap: on
line diff
--- a/app/models/tweet.rb	Fri Aug 03 02:03:21 2018 +0900
+++ b/app/models/tweet.rb	Fri Aug 03 02:12:41 2018 +0900
@@ -52,7 +52,7 @@
           if data[:result] == :ok
             user = data[:data]
 
-            if user.id_str != @twitter_id || user.screen_name != @twitter_id
+            if user.id.to_s != @twitter_id && user.screen_name != @twitter_id
               throw "Wrong user data. Requested: #{@twitter_id}, got: #{user.id} (#{user.screen_name.printable})"
             end
           end