Merge pull request #1030 from Ana06/public-schedule

New schedule
This commit is contained in:
Henne Vogelsang 2016-06-30 12:13:51 +02:00 committed by GitHub
commit 92e9043a57
11 changed files with 320 additions and 93 deletions

View file

@ -223,6 +223,13 @@ class Event < ActiveRecord::Base
(100 * result.values.count(true) / result.values.compact.count).to_s
end
##
# Returns end of the event
#
def end_time
self.start_time + self.event_type.length.minutes
end
private
##

View file

@ -10,6 +10,7 @@ class EventType < ActiveRecord::Base
alias_attribute :name, :title
# If LENGTH_STEP must be divisor of 60, otherwise the schedule wont be displayed properly
LENGTH_STEP = 15
private