mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
c09a4fd23d
Allow specifying what fixtures can be ignored by setting `ignore` in fixtures YAML file: # users.yml _fixture: ignore: - base base: &base admin: false introduction: "This is a default description" admin: <<: *base admin: true visitor: <<: *base In the above example, "base" fixture will be ignored when creating users fixture. This is helpful when you want to inherit attributes and it makes your fixtures more "DRY".
26 lines
452 B
YAML
26 lines
452 B
YAML
_fixture:
|
|
model_class: Book
|
|
ignore:
|
|
- PUBLISHED
|
|
- PUBLISHED_PAPERBACK
|
|
- PUBLISHED_EBOOK
|
|
|
|
PUBLISHED: &PUBLISHED
|
|
status: :published
|
|
|
|
PUBLISHED_PAPERBACK: &PUBLISHED_PAPERBACK
|
|
<<: *PUBLISHED
|
|
format: "paperback"
|
|
language: :english
|
|
|
|
PUBLISHED_EBOOK: &PUBLISHED_EBOOK
|
|
<<: *PUBLISHED
|
|
format: "ebook"
|
|
|
|
awdr:
|
|
<<: *PUBLISHED_PAPERBACK
|
|
name: "Agile Web Development with Rails"
|
|
|
|
rfr:
|
|
<<: *PUBLISHED_EBOOK
|
|
name: "Ruby for Rails"
|