Class: Setting::Dlm

Inherits:
Setting show all
Defined in:
app/models/settings/dlm.rb

Class Method Summary collapse

Class Method Details

.humanized_categoryObject



16
17
18
# File 'app/models/settings/dlm.rb', line 16

def self.humanized_category
  N_('Distributed Locks')
end

.load_defaultsObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/models/settings/dlm.rb', line 3

def self.load_defaults
  return unless ActiveRecord::Base.connection.table_exists?('settings')
  return unless super

  Setting.transaction do
    [
      set('dlm_stale_time', N_('Number of hours after which locked Distributed Lock is stale'), 4, N_('Distributed Lock stale time'))
    ].compact.each { |s| Setting::General.create s.update(category: 'Setting::General') }
  end

  true
end