Sha256: c7dac5b72857361a98577d0d14bdc1691462d30f538b95c0dc9561fce586a3b0

Contents?: true

Size: 633 Bytes

Versions: 8

Compression:

Stored size: 633 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
          $stderr.puts 'initializer roo_on_rails.database'

          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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
roo_on_rails-1.10.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.9.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.8.1 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.8.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.7.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.6.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.5.0 lib/roo_on_rails/railties/database.rb
roo_on_rails-1.4.0 lib/roo_on_rails/railties/database.rb