On Sep 27, 2010, at 8:44 AM, Chris Hanks wrote:
> On Sep 27, 6:51 am, Abel Tamayo <[email protected]> wrote:
>> It seems MongoMapper is more popular around here. At least it's the solution
>> I'm using and works flawlessly with Heroku.
>> On Mon, Sep 27, 2010 at 2:33 PM, Bradley <[email protected]> wrote:
>>> no one has a comment on this?  I thought it'd be a fairly straight
>>> forward answer.

Why bother with the YML file?

require "mongoid"
require "uri"

url = URI.parse ENV["MONGODB_URL"]
MONGO = Mongo::Connection.new(url.host, url.port).db url.path[1..-1]

if url.user && url.password
  unless MONGO.authenticate url.user, url.password
    raise "Couldn't authenticate MongoDB: #{url.to_s}"
  end
end

Mongoid.configure do |config|
  config.autocreate_indexes = true
  config.master = MONGO
  config.persist_in_safe_mode = false
  config.raise_not_found_error = false
end


-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to