Method deprecated
This method is deprecated on the latest stable version of Rails.
The last existing version (v2.1.0) is shown here.
connection=(spec)
public
Show source
def self.connection=(spec)
if spec.kind_of?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
active_connections[name] = spec
elsif spec.kind_of?(ConnectionSpecification)
config = spec.config.reverse_merge(:allow_concurrency => @@allow_concurrency)
self.connection = self.send(spec.adapter_method, config)
elsif spec.nil?
raise ConnectionNotEstablished
else
establish_connection spec
end
end