diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-09-30 11:06:41 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-09-30 11:06:41 +0200 |
commit | 591a0bb87fff7583e01156696fbbf929d48d3e54 (patch) | |
tree | a20695f744a7312b9fb20088f3dc1b516eaea5fa /activerecord/test/fixtures | |
parent | aef14fec0aa2fd33442165f37abca119bd0cfb9c (diff) | |
parent | 2acec4657752d441ab87b9f5862d7918843d6409 (diff) | |
download | rails-591a0bb87fff7583e01156696fbbf929d48d3e54.tar.gz rails-591a0bb87fff7583e01156696fbbf929d48d3e54.tar.bz2 rails-591a0bb87fff7583e01156696fbbf929d48d3e54.zip |
Merge pull request #20574 from repinel/fix-db-fixtures-load
Allow fixtures YAML files to set the model class in the file itself
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/bad_posts.yml | 9 | ||||
-rw-r--r-- | activerecord/test/fixtures/other_comments.yml | 6 | ||||
-rw-r--r-- | activerecord/test/fixtures/other_posts.yml | 7 |
3 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/bad_posts.yml b/activerecord/test/fixtures/bad_posts.yml new file mode 100644 index 0000000000..addee8e3bf --- /dev/null +++ b/activerecord/test/fixtures/bad_posts.yml @@ -0,0 +1,9 @@ +# Please do not use this fixture without `set_fixture_class` as Post + +_fixture: + model_class: BadPostModel + +bad_welcome: + author_id: 1 + title: Welcome to the another weblog + body: It's really nice today diff --git a/activerecord/test/fixtures/other_comments.yml b/activerecord/test/fixtures/other_comments.yml new file mode 100644 index 0000000000..55e8216ec7 --- /dev/null +++ b/activerecord/test/fixtures/other_comments.yml @@ -0,0 +1,6 @@ +_fixture: + model_class: Comment + +second_greetings: + post: second_welcome + body: Thank you for the second welcome diff --git a/activerecord/test/fixtures/other_posts.yml b/activerecord/test/fixtures/other_posts.yml new file mode 100644 index 0000000000..39ff763547 --- /dev/null +++ b/activerecord/test/fixtures/other_posts.yml @@ -0,0 +1,7 @@ +_fixture: + model_class: Post + +second_welcome: + author_id: 1 + title: Welcome to the another weblog + body: It's really nice today |