Sha256: 21ec43b463abd12cd12c57d1a1a11fa15e58eace90717d2389459792fa9ee877

Contents?: true

Size: 735 Bytes

Versions: 5

Compression:

Stored size: 735 Bytes

Contents

require 'foreman'

# We may be executing something like rake db:migrate:reset, which destroys this table
# only continue if the table exists
if (Setting.first rescue(false))
  # Avoid lazy-loading in development mode
  %w[General Puppet Auth Provisioning].each do |c|
    require_dependency Rails.root.join('app', 'models', 'setting', c.downcase).to_s
  end if Rails.env.development?

  Setting.descendants.each(&:load_defaults)
end

# We load the default settings for the roles if they are not already present
Foreman::DefaultData::Loader.load(false)

# clear our users topbar cache
begin
  User.unscoped.pluck(:id).each do |id|
    Rails.cache.delete("views/tabs_and_title_records-#{id}")
  end
rescue => e
  Rails.logger.warn e
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/config/initializers/foreman.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/config/initializers/foreman.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/config/initializers/foreman.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/config/initializers/foreman.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/config/initializers/foreman.rb