diff options
author | Matthew Draper <matthew@trebex.net> | 2017-04-04 04:12:56 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-04 04:12:56 +0930 |
commit | 3ecffab324fc03df76eba91e4c2a7cb89a0580b9 (patch) | |
tree | bdd0c432bcccc6e1aff60d7d3b9efa476a6bc7ba /activerecord | |
parent | 67d210f7d76a2fa96ff41560fed2910147787ad4 (diff) | |
parent | b66b5378baf3804e9985a7cb9630f6d5a3ddcf97 (diff) | |
download | rails-3ecffab324fc03df76eba91e4c2a7cb89a0580b9.tar.gz rails-3ecffab324fc03df76eba91e4c2a7cb89a0580b9.tar.bz2 rails-3ecffab324fc03df76eba91e4c2a7cb89a0580b9.zip |
Merge pull request #28057 from eugeneius/clear_active_connections
Clear active connections after initialization
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index 0276d41494..73518ca144 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -166,5 +166,13 @@ end_warning path = app.paths["db"].first config.watchable_files.concat ["#{path}/schema.rb", "#{path}/structure.sql"] end + + initializer "active_record.clear_active_connections" do + config.after_initialize do + ActiveSupport.on_load(:active_record) do + clear_active_connections! + end + end + end end end |