Module: Schedulable

Extended by:
ActiveSupport::Concern
Included in:
ContainerExpirationPolicy, CronSchedulable, Packages::Cleanup::Policy
Defined in:
app/models/concerns/schedulable.rb

Instance Method Summary collapse

Instance Method Details

#allow_next_run_at_update?Boolean

override this method to change the behavior

Returns:

  • (Boolean)


19
20
21
# File 'app/models/concerns/schedulable.rb', line 19

def allow_next_run_at_update?
  true
end

#schedule_next_run!Object



12
13
14
15
16
# File 'app/models/concerns/schedulable.rb', line 12

def schedule_next_run!
  save! # with set_next_run_at
rescue ActiveRecord::RecordInvalid
  update_column(:next_run_at, nil) # update without validation
end

#set_next_run_atObject

Raises:

  • (NotImplementedError)


23
24
25
# File 'app/models/concerns/schedulable.rb', line 23

def set_next_run_at
  raise NotImplementedError
end