Replace try with safe navigation operator (#3988) [ci skip]
This commit is contained in:
parent
653a266141
commit
b00505e9f4
1 changed files with 1 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ class Tweet < ApplicationRecord
|
|||
tweet = Tweet.where(twitter_id_code: tweeted.attrs[:id_str]).first_or_initialize
|
||||
tweet.twitter_uid = tweeted.user.id.to_s
|
||||
tweet.twitter_username = tweeted.user.screen_name.downcase
|
||||
tweet.user_id = User.find_by(twitter_username: tweeted.user.screen_name).try(:id)
|
||||
tweet.user_id = User.find_by(twitter_username: tweeted.user.screen_name)&.id
|
||||
tweet.favorite_count = tweeted.favorite_count
|
||||
tweet.retweet_count = tweeted.retweet_count
|
||||
tweet.in_reply_to_user_id_code = tweeted.attrs[:in_reply_to_user_id_str]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue