Module: Mongoid::Association::Builders

Extended by:
ActiveSupport::Concern
Included in:
Mongoid::Association
Defined in:
build/mongoid-7.0/lib/mongoid/association/builders.rb

Overview

This module is responsible for defining the build and create methods used in one to one relations.

Examples:

Methods that get created.


class Person
  include Mongoid::Document
  embeds_one :name
end

# The following methods get created:
person.build_name({ :first_name => "Durran" })
person.create_name({ :first_name => "Durran" })

Since:

  • 2.0.0.rc.1