lecture-attendance-manager/app/models/tracked_time_entry.rb

17 lines
277 B
Ruby

class TrackedTimeEntry < ApplicationRecord
belongs_to :lecture
enum :kind, [
:concurrent,
:catchup,
:preparation,
:review
]
def duration
toggl_data['time_entries'].sum { |entry| entry['seconds'] }
.seconds
end
end