Permalink
Browse files

Keep configuration for both mongoid 2 and 3

  • Loading branch information...
elia committed Jun 18, 2013
1 parent 3a385f8 commit 3b403c5226d6caa78ead4e3e8ce63ea55d0b3166
View
@@ -20,4 +20,5 @@ spec/reports
/test_app/log/*.log
/test_app/tmp/
/test_app/.sass-cache
+/test_app/config/mongoid.yml
/spec/rails
@@ -0,0 +1,7 @@
+require 'pathname'
+root = Pathname(File.expand_path('../..', __FILE__))
+version = Mongoid::VERSION.to_i
+
+current_config = root.join("config/mongoid.#{version}.yml").read
+config_file = root.join('config/mongoid.yml')
+config_file.open('w') {|c| c << current_config }
@@ -1,3 +1,4 @@
+require File.expand_path('../_link_mongoid_config', __FILE__)
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
@@ -0,0 +1,20 @@
+development:
+ host: localhost
+ database: test_app_development
+
+test:
+ host: localhost
+ database: test_app_test
+
+# set these environment variables on your prod server
+production:
+ host: <%= ENV['MONGOID_HOST'] %>
+ port: <%= ENV['MONGOID_PORT'] %>
+ username: <%= ENV['MONGOID_USERNAME'] %>
+ password: <%= ENV['MONGOID_PASSWORD'] %>
+ database: <%= ENV['MONGOID_DATABASE'] %>
+ # slaves:
+ # - host: slave1.local
+ # port: 27018
+ # - host: slave2.local
+ # port: 27019
File renamed without changes.

0 comments on commit 3b403c5

Please sign in to comment.