]> git.openstreetmap.org Git - rails.git/commitdiff
Replace to_s on TimeWithZone objects with to_formatted_s
authorTom Hughes <tom@compton.nu>
Mon, 10 Jan 2022 08:38:45 +0000 (08:38 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 10 Jan 2022 18:59:22 +0000 (18:59 +0000)
app/views/api/notes/_note.gpx.builder
app/views/api/notes/_note.rss.builder
app/views/api/notes/feed.rss.builder
app/views/changeset_comments/_comments.rss.builder
app/views/diary_entries/rss.rss.builder
app/views/traces/georss.rss.builder
test/controllers/api/notes_controller_test.rb

index f6bb39d27dc1347883785c5a76546fa42ecb12d2..74961b2e058649d0ad1fea32e0a95f2e721960a8 100644 (file)
@@ -1,5 +1,5 @@
 xml.wpt("lon" => note.lon, "lat" => note.lat) do
-  xml.time note.created_at.to_s(:iso8601)
+  xml.time note.created_at.to_formatted_s(:iso8601)
   xml.name t("browse.note.title", :id => note.id)
 
   xml.desc do
index 4dc47d158d5d12b41deae7e66e4bd5df095c5bc5..3e562d1a20365ea0aee61961743b033489bcd0ee 100644 (file)
@@ -15,7 +15,7 @@ xml.item do
 
   xml.dc :creator, note.author.display_name if note.author
 
-  xml.pubDate note.created_at.to_s(:rfc822)
+  xml.pubDate note.created_at.to_formatted_s(:rfc822)
   xml.geo :lat, note.lat
   xml.geo :long, note.lon
   xml.georss :point, "#{note.lat} #{note.lon}"
index 1b9e5b584ed90105b2ab4a19f090151dbeb9cba1..f0d00470beffd9a1ba8ca9be6618e9ed191064f5 100644 (file)
@@ -24,7 +24,7 @@ xml.rss("version" => "2.0",
 
         xml.dc :creator, comment.author.display_name if comment.author
 
-        xml.pubDate comment.created_at.to_s(:rfc822)
+        xml.pubDate comment.created_at.to_formatted_s(:rfc822)
         xml.geo :lat, comment.note.lat
         xml.geo :long, comment.note.lon
         xml.georss :point, "#{comment.note.lat} #{comment.note.lon}"
index 8848b9a80ddc8328de356936fe8bd9936cea441f..4136b24b492e94438f2f9ce3c0ad2746141853bb 100644 (file)
@@ -11,6 +11,6 @@ comments.each do |comment|
 
     xml.dc :creator, comment.author.display_name if comment.author
 
-    xml.pubDate comment.created_at.to_s(:rfc822)
+    xml.pubDate comment.created_at.to_formatted_s(:rfc822)
   end
 end
index be627437dd9b0ea8efb863e7d845f364dbfdeb1c..06361c49ede8d353d537231f452a64ad99fa9b73 100644 (file)
@@ -23,7 +23,7 @@ xml.rss("version" => "2.0",
         xml.guid diary_entry_url(entry.user, entry, :only_path => false)
         xml.description entry.body.to_html
         xml.dc :creator, entry.user.display_name
-        xml.pubDate entry.created_at.to_s(:rfc822)
+        xml.pubDate entry.created_at.to_formatted_s(:rfc822)
         xml.comments diary_entry_url(entry.user, entry, :anchor => "comments", :only_path => false)
 
         if entry.latitude && entry.longitude
index b17192ec81a1943da715d773817daa1d97ab1335..991f74ebbf194b173f17b256615d74ae9f25868c 100644 (file)
@@ -30,7 +30,7 @@ xml.rss("version" => "2.0",
 
         xml.dc :creator, trace.user.display_name
 
-        xml.pubDate trace.timestamp.to_s(:rfc822)
+        xml.pubDate trace.timestamp.to_formatted_s(:rfc822)
 
         if trace.latitude && trace.longitude
           xml.geo :lat, trace.latitude
index eb2af64f52d09357710aeb00f7f44a6b37a548a3..fe9127029e8125cf9b09a03f066b6903e587c8c4 100644 (file)
@@ -494,7 +494,7 @@ module Api
           assert_select "item", :count => 1 do
             assert_select "link", browse_note_url(open_note)
             assert_select "guid", note_url(open_note)
-            assert_select "pubDate", open_note.created_at.to_s(:rfc822)
+            assert_select "pubDate", open_note.created_at.to_formatted_s(:rfc822)
             #          assert_select "geo:lat", open_note.lat.to_s
             #          assert_select "geo:long", open_note.lon
             #          assert_select "georss:point", "#{open_note.lon} #{open_note.lon}"