mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
19 lines
329 B
Ruby
19 lines
329 B
Ruby
module Stopwatch
|
|
class IssueTimer
|
|
|
|
def initialize(issue:, user: User.current)
|
|
@issue = issue
|
|
@user = user
|
|
end
|
|
|
|
def running?
|
|
running_time_entry.present?
|
|
end
|
|
|
|
def running_time_entry
|
|
@running_time_entry ||= @issue.time_entries.find_by_id(@user.running_time_entry_id)
|
|
end
|
|
|
|
end
|
|
end
|