Sha256: d5ce0c521b63b6c7adf36a9163da189e96f121c6f066dfd8ba38cc1357b72b94

Contents?: true

Size: 705 Bytes

Versions: 9

Compression:

Stored size: 705 Bytes

Contents

module RooOnRails
  module Railties
    class Database < Rails::Railtie
      initializer 'roo_on_rails.database', after: 'active_record.initialize_database' do
        ActiveSupport.on_load :active_record do
          Rails.logger.with(initializer: 'roo_on_rails.database') do |log|
            log.debug 'loading'

            config = ActiveRecord::Base.configurations[Rails.env]
            config['variables'] ||= {}
            config['variables']['statement_timeout'] = ENV.fetch('DATABASE_STATEMENT_TIMEOUT', 200)
            config['reaping_frequency'] = ENV['DATABASE_REAPING_FREQUENCY']

            ActiveRecord::Base.establish_connection
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
roo_on_rails-1.16.1 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.16.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.15.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.14.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.13.1 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.13.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.12.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.11.1 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.11.0 lib/roo_on_rails/railties/database.rb