Set the connection for the class.
Source Code
# File active_record/connection_adapters/abstract/connection_specification.rb, line 286 def self.connection=(spec) #:nodoc: 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
<code/>and<pre/>for code samples.