class Bookfile::Database

Public Class Methods

new( db_config ) click to toggle source
# File lib/bookfile/database/database.rb, line 7
def initialize( db_config )
  @db_config = db_config
end

Public Instance Methods

connect() click to toggle source
# File lib/bookfile/database/database.rb, line 11
def connect
  print "  connecting..."
  ActiveRecord::Base.establish_connection( @db_config )
  puts "OK"
end
setup() click to toggle source
# File lib/bookfile/database/database.rb, line 17
def setup   ## use connect/prepare - why, why not??
  prepare   # step 1: prepare - require and include models
  connect   # step 2: connect
end