38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/merb_datamapper.rb', line 38
def self.run
Merb.logger.verbose! "Merb::Orms::DataMapper::Connect block."
if File.file?(Merb.dir_for(:config) / "database.yml")
Merb::Orms::DataMapper.connect
else
Merb.logger.info "No database.yml file found in #{Merb.dir_for(:config)}, assuming database connection(s) established in the environment file in #{Merb.dir_for(:config)}/environments"
end
Merb.logger.verbose! "Checking if we need to use DataMapper sessions"
if Merb::Config.session_store == 'datamapper'
Merb.logger.verbose! "Using DataMapper sessions"
require "merb_datamapper/data_mapper_session"
end
Merb::Router.root_behavior = Merb::Router.root_behavior.identify(DataMapper::Resource => :id)
Merb.logger.verbose! "Merb::Orms::DataMapper::Connect complete"
end
|