openstreetmap-website/app/views/notes/_note.rss.builder
Kai Krueger 0a3aba7f89 Remove nearby_place from the note model
Instead of storing the auto-generated meta information nearby_place
in the database, just look up the information on the fly when needed
and cache it for performance.
2012-12-01 18:18:09 +00:00

21 lines
774 B
Ruby

xml.item do
location_string = Rails.cache.fetch("location_description_#{note.lat}_#{note.lon}_#{locale}") do
describe_location note.lat, note.lon, 14, locale
end
if note.status == "closed"
xml.title t('note.rss.closed', :place => location_string)
elsif note.comments.length > 1
xml.title t('note.rss.comment', :place => location_string)
else
xml.title t('note.rss.new', :place => location_string)
end
xml.link browse_note_url(note)
xml.guid note_url(note)
xml.description render(:partial => "description", :object => note, :formats => [ :html ])
xml.author note.comments.first.author_name
xml.pubDate note.updated_at.to_s(:rfc822)
xml.geo :lat, note.lat
xml.geo :long, note.lon
xml.georss :point, "#{note.lat} #{note.lon}"
end