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

remotes/origin/master
echarp 5 years ago
parent 5807c44b70
commit 613b1f0e0a

@ -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

@ -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

@ -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)

Loading…
Cancel
Save