mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 17:51:59 -04:00
15 lines
250 B
Ruby
15 lines
250 B
Ruby
module Stopwatch
|
|
module TimeEntryPatch
|
|
extend ActiveSupport::Concern
|
|
|
|
prepended do
|
|
before_destroy :stop_timer
|
|
end
|
|
|
|
def stop_timer
|
|
t = Stopwatch::Timer.new(user)
|
|
t.update(stop: true) if t.running?
|
|
end
|
|
end
|
|
end
|