From 71dacea387cb9a7786be10f7f5569da4e372c99d Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Mon, 27 Jun 2011 17:33:58 -0400 Subject: [PATCH] Update the sequence documentation Closes #135 --- GETTING_STARTED.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index e78661a58..310455d51 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -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 ---------