forked from mongodb/mongoid
    
        
        - 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Hints and tips
        tmaier edited this page Nov 2, 2011 
        ·
        2 revisions
      
    This is a collection of hints and tips which are not (yet) documented at mongoid.org.
mongoid.org shall always be the first reference, however If something is worth being noted, this could be a good starting point.
Ref. #1207
module ItchySpot
  class Dog
    include Mongoid::Document
    embeds_one :collar
  end
end
class Collar
  include Mongoid::Document
  embedded_in :dog, class_name: "ItchySpot::Dog"
endmodule ItchySpot
  class Dog
    include Mongoid::Document
    embeds_one :collar, class_name: "::Collar"
  end
  class Collar
    include Mongoid::Document
    embedded_in :dog, class_name: "::Dog"
  end
end