Skip to content

Instantly share code, notes, and snippets.

@mhuebert
Created November 3, 2010 02:25
Show Gist options
  • Save mhuebert/660715 to your computer and use it in GitHub Desktop.
Save mhuebert/660715 to your computer and use it in GitHub Desktop.
mongo_db = case Padrino.env
when :development then "overlap-dev-test-local"
when :production then "overlap-01"
when :test then "overlap-01-test"
end
port = case Padrino.env
when :development then "27017"
when :production then "27051"
when :test then "27031"
end
mongo_uri = case Padrino.env
when :development then "mongodb://localhost:"+port
when :production then "mongodb://user:[email protected]:"+port+"/"+mongo_db
when :test then "mongodb://user:[email protected]:"+port+"/"+mongo_db
end
Mongoid.database = Mongo::Connection.from_uri(mongo_uri).db(mongo_db)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment