app/models/item.rb
# returns one millisecond before the start time of the next item if there
# is a next item, otherwise the end time of the video
returns one millisecond before the start time of the next item if there
is a next item, otherwise the end time of the video
returns one millisecond before the start time of the next item if there is a next item otherwise the end time of the video
def end_time
    return unless video?
    return TimeStamp.new(total_seconds: medium.video_duration) if next_item.nil?
    TimeStamp.new(total_seconds: next_item.start_time.total_seconds - 0.001)
  end
def end_time return unless video? return TimeStamp . new ( total_seconds : medium . video_duration ) if next_item . nil? TimeStamp . new ( total_seconds : next_item . start_time . total_seconds - 0.001 ) end
returns one millisecond before the start time of the next item if there
is a next item, otherwise the end time of the video
returns one millisecond before the start time of the next item if there is a next item otherwise the end time of the video