Skip to content
notahat edited this page Aug 23, 2010 · 2 revisions
User.blueprint do
  username { "user#{serial_number}" }
end

- Abbreviate to sn
- Returns a string, four digits

Serial Numbers and Inheritance

Serial numbers for subclasses are pulled from the parent class to avoid clashes.

ParentClass.blueprint do
  name { "Parent #{sn}" }
end

ChildClass.blueprint do
  name { "Child  #{sn}" }
end

ParentClass.make  # "Parent 0001"
ChildClass.make   # "Child  0002"
ParentClass.make  # "Parent 0003"
Clone this wiki locally