Module: Mongoid::Relations::Builders

Extended by:
ActiveSupport::Concern
Included in:
Mongoid::Relations
Defined in:
lib/mongoid/relations/builders.rb,
lib/mongoid/relations/builders/embedded/in.rb,
lib/mongoid/relations/builders/embedded/one.rb,
lib/mongoid/relations/builders/embedded/many.rb,
lib/mongoid/relations/builders/referenced/in.rb,
lib/mongoid/relations/builders/referenced/one.rb,
lib/mongoid/relations/builders/referenced/many.rb,
lib/mongoid/relations/builders/nested_attributes/one.rb,
lib/mongoid/relations/builders/nested_attributes/many.rb,
lib/mongoid/relations/builders/referenced/many_to_many.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

Defined Under Namespace

Modules: ClassMethods, Embedded, NestedAttributes, Referenced