I'm setting up an Artist
model that has name
and birth_name
attributes. In some cases, an artist's stage name is synonomous with their real name, vice-versa. What I'd like to do in my factory is use the birth_name
(created using Faker) as the name
attribute. I tried simply referencing as so:
FactoryGirl.define do
factory :artist do
name { birth_name }
birth_name { Faker::Name.name }
end
end
but get this error:
ArgumentError: Factory not registered: birth_name
What's the best way to get this to work?