Class: Decidim::TimeTracker::StopCounterJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/time_tracker/stop_counter_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(time_event) ⇒ Object

time_event - the counter to stop, only stopped if it’s due time is reached



10
11
12
13
14
15
16
# File 'app/jobs/decidim/time_tracker/stop_counter_job.rb', line 10

def perform(time_event)
  @time_event = time_event
  return if @time_event.stopped?
  return if time_available?

  @time_event.stop!
end