Module: DelayedJobConfiguration

Extended by:
ActiveSupport::Concern
Defined in:
lib/app/models/concerns/delayed_job_configuration.rb

Overview

The Slack Configuration to be used inside of SystemConfiguration

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/app/models/concerns/delayed_job_configuration.rb', line 9

def self.included(base)
  base.class_eval do
    #
    # Fields
    #
    field :delayed_job_max_allowed_method, type: String, default: 'max'
    field :delayed_job_max_allowed_factor, type: Integer, default: 5
    field :delayed_job_restart_orphaned, type: Mongoid::Boolean, default: false
    #
    # Validations
    #
    validates :delayed_job_max_allowed_method, inclusion: { in: %w[max min avg] }
    validates :delayed_job_max_allowed_factor, numericality: { greater_than: 0 }
  end
end