Skip to content

Instantly share code, notes, and snippets.

@mepatterson
Created March 12, 2010 17:37
Show Gist options
  • Select an option

  • Save mepatterson/330559 to your computer and use it in GitHub Desktop.

Select an option

Save mepatterson/330559 to your computer and use it in GitHub Desktop.
config = YAML.load(File.read(File.join(Rails.root, "config", "mongo.yml")))
MongoMapper.setup(config, Rails.env, { :logger => Rails.logger })
module IdentityMapAddition
def self.included(model)
model.plugin MongoMapper::Plugins::IdentityMap
end
end
MongoMapper::Document.append_inclusions(IdentityMapAddition)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment