lib/capcode/base/dm.rb in capcode-base-datamapper-0.1.0 vs lib/capcode/base/dm.rb in capcode-base-datamapper-0.2.0
- old
+ new
@@ -1,8 +1,9 @@
require 'rubygems'
begin
require 'dm-core'
+ require 'dm-migrations'
rescue LoadError => e
raise Capcode::MissingLibrary, "DataMapper could not be loaded (is it installed?): #{e.message}"
end
require 'yaml'
require 'logger'
@@ -23,11 +24,11 @@
end
class << self
def db_connect( dbfile, logfile ) #:nodoc:
dbconfig = YAML::load(File.open(dbfile)).keys_to_sym
- DataMapper.setup(:default, dbconfig)
DataMapper::Logger.new(logfile, :debug)
+ DataMapper.setup(:default, dbconfig)
DataMapper.auto_upgrade!
end
end
end
\ No newline at end of file