Sha256: 161041e05867fee226e6bef7ac89aac7fc09ecbcd749f78654be9d5ca6c6f7c7

Contents?: true

Size: 300 Bytes

Versions: 8

Compression:

Stored size: 300 Bytes

Contents

class ConnectionAdapter
  attr_reader :adapter, :database

  def initialize(database, adapter="sqlite3")
    @adapter = adapter
    @database = database
  end

  def connect!
    ActiveRecord::Base.establish_connection(
      :adapter => self.adapter,
      :database => self.database
    )
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
learn-generate-1.0.16 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.15 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.14 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.13 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.12 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.11 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.1 lib/templates/activerecord/lib/support/connection_adapter.rb
learn-generate-1.0.0 lib/templates/activerecord/lib/support/connection_adapter.rb