Skip to content

Instantly share code, notes, and snippets.

@nalanj
Created February 20, 2009 02:23
Show Gist options
  • Save nalanj/67261 to your computer and use it in GitHub Desktop.
Save nalanj/67261 to your computer and use it in GitHub Desktop.
# Cycling Through A Set of Strings With Sequency
#
# It's pretty easy to use Sequency (http://github.com/commondream/sequency) to cycle through a set of
# strings when creating factories.
#
# I got this data from the US Social Security Administration website (http://www.ssa.gov/OACT/babynames/)
Sequence.define(:first_name) do |i|
names = %w( Jacob Emily Michael Isabella Ethan Emma Joshua Ava Daniel Madison Christopher
Sophia Anthony Olivia William Abigail Matthew Hannah Andrew Elizabeth )
names[i % names.length]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment