# File lib/mongoid/relations/embedded/many.rb, line 52 def build(attributes = {}, options = {}, type = nil) if options.is_a? Class options, type = {}, options end Factory.build(type || metadata.klass, attributes, options).tap do |doc| doc.identify append(doc) yield(doc) if block_given? end end