1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Update the sequence documentation

Closes #135
This commit is contained in:
Joshua Clayton 2011-06-27 17:33:58 -04:00
parent f33a64e0d1
commit 71dacea387

View file

@ -190,6 +190,18 @@ a particular factory:
sequence(:email) {|n| "person#{n}@example.com" }
end
You can also override the initial value:
factory :user do
sequence(:email, 1000) {|n| "person#{n}@example.com" }
end
Without a block, the value will increment itself, starting at its initial value:
factory :post do
sequence(:position)
end
Callbacks
---------