Initial XML export support (FRAB compatible)
This commit is contained in:
parent
1cc2b0cac2
commit
628e433fbc
6 changed files with 51 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
##
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue