Sometimes we use the domain name as part of a global ID, now this domain name comes from request.domain

This commit is contained in:
echarp 2018-07-14 18:17:21 +02:00
parent 5807c44b70
commit 613b1f0e0a
3 changed files with 3 additions and 7 deletions

View File

@ -1,12 +1,10 @@
:ruby
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
# Create a calendar with an event (standard method)
cal = Icalendar::Calendar.new
@events.each do |event|
cal.event do |e|
e.dtstamp = Icalendar::Values::DateTime.new event.decision_time
e.uid = "#{event.id}@#{domain}"
e.uid = "#{event.id}@#{request.domain}"
e.dtstart = Icalendar::Values::DateTime.new event.start_time
e.dtend = Icalendar::Values::DateTime.new event.end_time
e.summary = event.title

View File

@ -1,6 +1,5 @@
def meta(xml, event)
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
xml.dc :identifier, "#{event.id}@#{domain}"
xml.dc :identifier, "#{event.id}@#{request.domain}"
xml.dc :date, l(event.start_time, format: :xml)
return unless event.latitude || event.longitude

View File

@ -66,8 +66,7 @@ xml.rdf :RDF,
xml.item 'rdf:about' => url do
xml.title "#{version.event} - #{object}"
xml.link url
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
xml.dc :identifier, "version_#{version.id}@#{domain}"
xml.dc :identifier, "version_#{version.id}@#{request.domain}"
xml.dc :date, version.created_at.iso8601
if object.try(:description)