static public Method

Base.clear_reloadable_connections!

Clears the cache which maps classes

Source Code

# File active_record/connection_adapters/abstract/connection_specification.rb, line 91
def clear_reloadable_connections!
  if @@allow_concurrency
    # With concurrent connections @@active_connections is
    # a hash keyed by thread id.
    @@active_connections.each do |thread_id, conns|
      conns.each do |name, conn|
        if conn.requires_reloading?
          conn.disconnect!
          @@active_connections[thread_id].delete(name)
        end
      end
    end
  else
    @@active_connections.each do |name, conn|
      if conn.requires_reloading?
        conn.disconnect!
        @@active_connections.delete(name)
      end
    end
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.