MS IZ set up mongoid and got rid of activerecord sqlite3 nonsense

This commit is contained in:
Maxwell Salzberg 2010-06-12 00:59:19 -07:00
parent 0390bbde8a
commit a663844eef
4 changed files with 36 additions and 7 deletions

View file

@ -5,7 +5,10 @@ gem 'rails', '3.0.0.beta4'
# Bundle edge Rails instead: # Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git' # gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3' #gem 'sqlite3-ruby', :require => 'sqlite3'
gem "mongoid", :git => "http://github.com/durran/mongoid.git"
gem "bson_ext", "1.0.1"
# Use unicorn as the web server # Use unicorn as the web server
# gem 'unicorn' # gem 'unicorn'
@ -14,7 +17,7 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'capistrano' # gem 'capistrano'
# To use debugger # To use debugger
# gem 'ruby-debug' gem 'ruby-debug'
# Bundle the extra gems: # Bundle the extra gems:
# gem 'bj' # gem 'bj'

View file

@ -1,6 +1,8 @@
require File.expand_path('../boot', __FILE__) require File.expand_path('../boot', __FILE__)
require 'rails/all' require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
# If you have a Gemfile, require the gems listed there, including any gems # If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
@ -31,11 +33,11 @@ module Diaspora
# config.i18n.default_locale = :de # config.i18n.default_locale = :de
# Configure generators values. Many other options are available, be sure to check the documentation. # Configure generators values. Many other options are available, be sure to check the documentation.
# config.generators do |g| config.generators do |g|
# g.orm :active_record g.orm :mongoid
# g.template_engine :erb # g.template_engine :erb
# g.test_framework :test_unit, :fixture => true g.test_framework :rspec
# end end
# Configure the default encoding used in templates for Ruby 1.9. # Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8" config.encoding = "utf-8"

24
config/mongoid.yml Normal file
View file

@ -0,0 +1,24 @@
defaults: &defaults
host: localhost
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
development:
<<: *defaults
database: diaspora_development
test:
<<: *defaults
database: diaspora_test
# set these environment variables on your prod server
production:
<<: *defaults
host: <%= ENV['MONGOID_HOST'] %>
port: <%= ENV['MONGOID_PORT'] %>
username: <%= ENV['MONGOID_USERNAME'] %>
password: <%= ENV['MONGOID_PASSWORD'] %>
database: <%= ENV['MONGOID_DATABASE'] %>