Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Single collection inheritance now requires connecting to database in version 0.12.0 #460

Closed
kbullaughey opened this Issue · 4 comments

3 participants

@kbullaughey

In 0.11.1, I can do this without mongo running:

require 'mongo_mapper'
class A; include MongoMapper::Document; end
class B < A; end

But in 0.12.0, for some reason it tries to connect to the database and I get an error:

Mongo::ConnectionFailure: Failed to connect to a master node at localhost:27017

It seems like defining classes shouldn't require a connection to the database.

@kbullaughey

btw, this only happens with the current master head, not the 0.12.0 version in rubygems.

@paulwalker

This is pretty problematic for us as well, has it been addressed yet?

@paulwalker

John, perhaps consider:

# @api public
def connection
  @@connection ||= Mongo::MongoClient.new(:connect => !ENV['MONGODB_URI'].nil?)
end
@jnunemaker
Owner

@paulwalker consider that where?

@cheald cheald closed this in 1456861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.