switch to mongodb

This commit is contained in:
fahchen
2013-01-30 15:37:17 +08:00
parent 52cd4f6700
commit a17f0ff48b
4 changed files with 40 additions and 1 deletions

2
.gitignore vendored
View File

@@ -18,3 +18,5 @@ capybara-*.html
rerun.txt
pickle-email-*.html
.project
todo.md

View File

@@ -38,3 +38,6 @@ gem 'jbuilder', '~> 1.0.1'
# To use debugger
# gem 'debugger'
# Mongodb
gem 'mongoid', git: 'git://github.com/mongoid/mongoid.git', branch: '4.0.0-dev'

View File

@@ -22,9 +22,15 @@ module QingshuiTemple
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
config.time_zone = 'Beijing'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.i18n.default_locale = "zh-CN"
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
end
end

28
config/mongoid.yml Normal file
View File

@@ -0,0 +1,28 @@
defaults: &defaults
options:
identity_map_enabled: true
development:
<<: *defaults
sessions:
default:
hosts:
- 127.0.0.1:27017
database: qingshui_temple_dev
test:
<<: *defaults
sessions:
default:
hosts:
- 127.0.0.1:27017
database: qingshui_temple_test
# set these environment variables on your prod server
production:
<<: *defaults
sessions:
default:
hosts:
- 127.0.0.1:27017
database: qingshui_temple