Initial XML export support (FRAB compatible)

This commit is contained in:
Daniel Molkentin 2016-06-11 00:53:51 +02:00
parent 1cc2b0cac2
commit 628e433fbc
6 changed files with 51 additions and 0 deletions

View file

@ -223,6 +223,12 @@ class Event < ActiveRecord::Base
(100 * result.values.count(true) / result.values.compact.count).to_s
end
##
# Returns the slug of an event
def slugify
"#{self.id}-#{self.title.downcase.gsub(/[^a-z1-9]+/, '-').chomp('-')}"
end
private
##

View file

@ -12,6 +12,13 @@ class EventType < ActiveRecord::Base
LENGTH_STEP = 15
##
# Return the length in timestamp format (HH:MM)
#
def length_timestamp
[self.length / 60, self.length % 60].map { |t| t.to_s.rjust(2,'0') }.join(':')
end
private
##