Skip to content

Instantly share code, notes, and snippets.

@a2ikm
Created September 15, 2023 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a2ikm/ba3af998cd2a9db840dc6c2ee9420209 to your computer and use it in GitHub Desktop.
Save a2ikm/ba3af998cd2a9db840dc6c2ee9420209 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "mongo_mapper"
end
# You can boot MongoDB with Docker:
# $ docker run -it --publish 27017:27017 --rm mongo
MongoMapper.setup({"development" => {"uri" => "mongodb://localhost:27017/test"}}, "development")
# Your test goes here.
class Parent
include MongoMapper::Document
one :child
end
class Child
include MongoMapper::Document
belongs_to :parent
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment