# HG changeset patch # User nanaya # Date 1603048110 -32400 # Node ID 70e90ea4b870dd9d8090dee24ba4f47c18e58e77 # Parent af84c9f23263607a41ba7942920a1109128e357e Fix uri for nil user diff -r af84c9f23263 -r 70e90ea4b870 app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb Mon Oct 19 03:42:22 2020 +0900 +++ b/app/helpers/application_helper.rb Mon Oct 19 04:08:30 2020 +0900 @@ -20,4 +20,8 @@ urls[url] || url end end + + def status_url(tweet) + "https://twitter.com/#{tweet.user.screen_name.presence || '_'}/status/#{tweet.id}" + end end diff -r af84c9f23263 -r 70e90ea4b870 app/views/tweets/_tweet.atom.erb --- a/app/views/tweets/_tweet.atom.erb Mon Oct 19 03:42:22 2020 +0900 +++ b/app/views/tweets/_tweet.atom.erb Mon Oct 19 04:08:30 2020 +0900 @@ -2,7 +2,7 @@ <%= atom_id "#{tweet.user.id}/#{tweet.id}" %> <%= tweet.created_at.xmlschema %> <%= tweet.created_at.xmlschema %> - + <%= truncate tweet.unescaped_text, :length => 30 %>
diff -r af84c9f23263 -r 70e90ea4b870 app/views/tweets/_tweet.html.erb --- a/app/views/tweets/_tweet.html.erb Mon Oct 19 03:42:22 2020 +0900 +++ b/app/views/tweets/_tweet.html.erb Mon Oct 19 04:08:30 2020 +0900 @@ -1,6 +1,6 @@ <% if tweet.retweeted_status.present? %>

- <%= link_to tweet.retweeted_status.uri.to_s do %> + <%= link_to status_url(tweet.retweeted_status) do %> Retweeted: <% end %>