Skip to content

Commit

Permalink
Replace to_s on TimeWithZone objects with to_formatted_s
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 10, 2022
1 parent b676aa7 commit 6403515
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/api/notes/_note.gpx.builder
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/notes/_note.rss.builder
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/notes/feed.rss.builder
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion app/views/changeset_comments/_comments.rss.builder
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/views/diary_entries/rss.rss.builder
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/traces/georss.rss.builder
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/api/notes_controller_test.rb
Expand Up @@ -494,7 +494,7 @@ def test_show_success
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}"
Expand Down

0 comments on commit 6403515

Please sign in to comment.