开发者

Comparing ruby DateTime with sqlite Date

开发者 https://www.devze.com 2023-04-11 09:55 出处:网络
I am attempting to pull tweets from twitter and store them in an sqlite db.In order to prevent duplication I wish to ignore tweets where the user开发者_如何学Python AND the time created already exist

I am attempting to pull tweets from twitter and store them in an sqlite db. In order to prevent duplication I wish to ignore tweets where the user开发者_如何学Python AND the time created already exist in the DB. So my code is

if Tweet.exists?(['twitter_created_at = ? AND from_user_id_str = ?', (tweet_results.created_at), tweet_results.from_user_id_str])

Now, through taking out the user_id parts i can tell that the problem is with the comparison between

twitter_created_at

tweet_results.created_at

I have been in the debugger and seen that the dates do match but i cannot get the statement to come back true.

thanks in advance.

0

精彩评论

暂无评论...
验证码 换一张
取 消