Created
September 15, 2023 16:40
-
-
Save a2ikm/ba3af998cd2a9db840dc6c2ee9420209 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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