1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/fixtures/other_books.yml
Tongfei Gao c09a4fd23d Allow specify fixtures to be ignored
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".
2019-07-27 16:40:16 +08:00

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"