Permalink
Browse files

Configured DataMapper to work with SQLite3.

Configured per-environment settings.
  • Loading branch information...
francois committed Oct 17, 2008
1 parent 8ae4691 commit 2005ba9d541cf10325fc8673781dee6f75b06219
Showing with 10 additions and 15 deletions.
  1. +7 −15 config/database.yml
  2. +3 −0 config/initializers/datamapper.rb
View
@@ -1,19 +1,11 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
+development: &defaults
+ :adapter: sqlite3
+ :database: db/development.sqlite3
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
+ <<: *defaults
+ :database: db/test.sqlite3
production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
+ <<: *defaults
+ :database: db/production.sqlite3
@@ -0,0 +1,3 @@
+require "dm-core"
+hash = YAML.load(File.new(Rails.root + "/config/database.yml"))
+DataMapper.setup(:default, hash[Rails.env])

0 comments on commit 2005ba9

Please sign in to comment.