Created
February 10, 2010 20:02
-
-
Save nicksieger/300782 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monkeypatch to disable connection pooling in ActiveRecord | |
module ActiveRecord | |
module ConnectionAdapters | |
class ConnectionPool | |
def checkout | |
c = ActiveRecord::Base.send(spec.adapter_method, spec.config.dup) | |
c.verify! | |
c | |
end | |
def checkin(conn) | |
conn.disconnect! | |
end | |
# Disable @connection_mutex around these methods | |
[:clear_reloadable_connections!, :verify_active_connections!, | |
:connected?, :disconnect!].each do |m| | |
aliased_method, punctuation = m.to_s.sub(/([?!=])$/, ''), $1 | |
alias_method m, "#{aliased_method}_without_synchronization#{punctuation}" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment