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
1 changed files with 12 additions and 0 deletions

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
---------