lib/tako/repository.rb in tako-0.3.0 vs lib/tako/repository.rb in tako-0.3.1

- old
+ new

@@ -7,9 +7,18 @@ def proxy_connections @proxy_connections ||= {} end + def clear + proxy_connections.each do |shard_name, connection| + connection.disconnect! + remove_const("TAKO_AR_CLASS_#{shard_name.upcase}") + end + proxy_configs.clear + proxy_connections.clear + end + def add(shard_name, conf) shard_name = shard_name.to_sym return if proxy_configs[shard_name] temporary_class = Class.new(ActiveRecord::Base)