Sha256: f574b6755545b96bc31567519af46fca1f8e5fdbefda9b4226ae559cdcfbc57a

Contents?: true

Size: 446 Bytes

Versions: 1

Compression:

Stored size: 446 Bytes

Contents

require 'factory_bot'

FactoryBot.define do
	factory :parent_document do
		trait :with_documents do
			after(:create) do |parent, evaluator|
				3.times { FactoryBot.create(:document, parent_document: parent) }
			end
		end
	end

	factory :document do
		trait :with_embedded_docs do
			after(:create) do |parent, evaluator|
				3.times { FactoryBot.create(:embedded_document, document: parent) }
			end
		end
	end

	factory :embedded_document
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-sortable-1.0.0 spec/support/factories.rb