{"published":"2010-12-21 12:20:37","version":"1.0","url":"https://mather.hatenablog.jp/entry/20101221/1292901637","type":"rich","image_url":null,"author_url":"https://blog.hatena.ne.jp/mather314/","categories":["Mongoid","Rails"],"blog_title":"My Brain is Open.","description":"MongoDB\u306e\uff08\u57cb\u3081\u8fbc\u307f\u3067\u306a\u3044\uff09\u53c2\u7167\u3092\u7528\u3044\u308b references_one \u306e\u6319\u52d5\u306b\u3064\u3044\u3066\u3002 class Person include Mongoid::Document field :name references_one :car end class Car include Mongoid::Document field :name referenced_in :person end \u30e2\u30c7\u30eb\u304c\u3053\u3046\u306a\u3063\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u6b21\u306e\u3088\u3046\u306a\u8eca\u306e\u53d6\u308a\u5408\u3044\u3092\u3084\u3063\u3066\u307f\u307e\u3059\uff57 p1 = Person.new(:name => \"hoge\") # => BSON::ObjectId('...000001') p2\u2026","width":"100%","blog_url":"https://mather.hatenablog.jp/","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","height":"190","author_name":"mather314","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmather.hatenablog.jp%2Fentry%2F20101221%2F1292901637\" title=\"references_one\u306e\u6319\u52d5 - My Brain is Open.\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"references_one\u306e\u6319\u52d5"}