1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Update GETTING_STARTED.md

-clearer docs!
This commit is contained in:
Jeffrey Wan 2016-03-15 14:37:56 -04:00 committed by Joshua Clayton
parent 85c214d552
commit 64c7c1360f

View file

@ -173,8 +173,7 @@ end
Aliases Aliases
------- -------
FactoryGirl allows you to define aliases to existing factories to make them easier to re-use. This could come in handy when, for example, your Post object has a author attribute that actually refers to an instance of a User class. While normally FactoryGirl can infer the factory name from the association name, in this case it will look for a author factory in vain. So, alias your user factory so it can be used under alias names.
Aliases allow you to use named associations more easily.
```ruby ```ruby
factory :user, aliases: [:author, :commenter] do factory :user, aliases: [:author, :commenter] do