Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
kbullaughey opened this Issue Oct 2, 2012 · 4 comments

Comments

Projects
None yet
3 participants

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.

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

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

John, perhaps consider:

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

jnunemaker commented Feb 15, 2013

@paulwalker consider that where?

@cheald cheald closed this in 1456861 Jul 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment