Mongoid::Document ã¯ãembeds_one, embeds_many, embedded_in ã¨ãã£ããActiveRecord ã¹ã¿ã¤ã«ã®3ã¤ã®ãã¯ããéãã¦ãä»ã®ããã¥ã¡ã³ãã«å¯¾ãã¦é¢é£ãè¨å®ãããã¨ãã§ãã¾ããé¢é£ãè¨å®ããã¨ã1ã¤ã®ããã¥ã¡ã³ããä»ã®ãã¹ã¦ã®ããã¥ã¡ã³ãã®ã«ã¼ãã«ãªããå
¨ã¦ã®é¢é£ä»ãããããªãã¸ã§ã¯ãã¯ã«ã¼ãããã¥ã¡ã³ãã«åãè¾¼ã¾ãã¾ãããªã¬ã¼ã·ã§ãã«ãªé¢é£ã¯ãããã®ãã¯ãã§ã¯è¨å®ã§ãã¾ãããå¾è¿°ãããªã¬ã¼ã·ã§ãã«ãªé¢é£ã®é
ãè¦ã¦ãã ããã å
ã®ä¾ã® Person ã¢ãã«ããä»ã®ããã¥ã¡ã³ãã¨é¢é£ããå ´åãèãã¦ã¿ã¾ãããã app/models/person.rb: class Person include Mongoid::Document field :first_name field :last_name embeds_one :addr
{{#tags}}- {{label}}
{{/tags}}