rails/activerecord/test/fixtures
Kevin Newton 006eb25ccd
Raise error on invalid fixture primary key
When you're using a custom primary key on a belongs_to and you're trying to load that value through the association shorthand in a fixture, you end up getting the primary key of the table and not the primary key specified in the join. This makes sense to keep as the behavior because it's super fast (just hashing the name of the fixture), but it's still surprising so we should want the developer that it's not possible to do what they want.
2021-07-14 08:54:38 -04:00
..
admin Fix backward compatibility with stored Hash values. Wrap coders to convert serialized values to indifferent access. 2012-05-30 23:21:57 -07:00
all remove duplicated fixture set names 2016-09-12 08:14:10 +09:00
categories Add missing fixtures for #3937. 2006-02-28 17:46:16 +00:00
naked/yml Use bulk INSERT to insert fixtures 2017-06-20 13:18:53 -04:00
primary_key_error Raise error on invalid fixture primary key 2021-07-14 08:54:38 -04:00
reserved_words Quote primary key in the subselect generated by mysql2 adapter 2017-12-19 20:59:09 +09:00
to_be_linked load fixtures from linked folders 2013-08-05 16:35:49 -03:00
accounts.yml Fix has_one with foreign_key and primary_key association bug which caused the associated object being lost when saving the owner. [#1756 state:resolved] 2009-09-12 16:03:32 +02:00
author_addresses.yml Fix test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct to NULL-agnostic way 2015-12-19 17:38:42 +09:00
author_favorites.yml add self referential has_many :through example [Rick] 2006-03-21 01:07:16 +00:00
authors.yml Fix test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct to NULL-agnostic way 2015-12-19 17:38:42 +09:00
bad_posts.yml Merge pull request #20574 from repinel/fix-db-fixtures-load 2015-09-30 11:06:41 +02:00
binaries.yml Add binary helper method to fixtures. 2017-08-12 18:35:32 +09:00
books.yml Fix pluck to correctly type cast same column names and association columns 2020-05-13 20:24:42 +09:00
bulbs.yml make it possible to access fixtures excluded by a default_scope. 2014-11-21 14:57:25 +01:00
cars.yml order should always be concatenated. 2010-09-05 08:13:42 -03:00
categories_ordered.yml fixing 1.8 support for new fixture tests 2011-05-23 15:06:13 -07:00
categories_posts.yml Fix joins that reserved word association is referenced in where 2021-01-18 16:24:22 +09:00
categories.yml First bit of support for habtm in through assocs - test_has_many_through_has_many_with_has_and_belongs_to_many_source_reflection now passes 2010-10-13 01:29:09 +01:00
categorizations.yml Added test_has_many_through_has_many_with_has_many_through_habtm_source_reflection and make it pass 2010-10-14 12:59:16 +01:00
citations.yml Lazy checking whether or not values in IN clause are boundable 2018-10-24 11:26:49 +09:00
clubs.yml Add test_has_one_through_has_one_through_with_belongs_to_source_reflection 2010-10-14 13:44:32 +01:00
collections.yml Refactor compute_type to handle situations where the correct class is already loaded 2010-04-12 21:31:20 -07:00
colleges.yml added test for #3732 2012-02-10 17:35:22 -05:00
comments.yml Avoid stack level too deep in predicate builder 2021-02-11 11:32:20 -05:00
companies.yml Avoid stack level too deep in predicate builder 2021-02-11 11:32:20 -05:00
computers.yml Should not fail if mangling enum names collision 2021-01-01 15:03:15 +09:00
content_positions.yml Add support for bidirectional destroy dependencies 2015-01-16 11:41:43 +00:00
content.yml Add support for bidirectional destroy dependencies 2015-01-16 11:41:43 +00:00
courses.yml added test for #3732 2012-02-10 17:35:22 -05:00
customers.yml Fix expanding an array of composed_of objects which have multiple mappings 2018-01-29 09:24:14 +09:00
dashboards.yml If a has_many goes :through a belongs_to, and the foreign key of the belongs_to changes, then the has_many should be considered stale. 2010-12-23 15:19:18 -08:00
dead_parrots.yml Fixes #18492 2015-01-14 21:36:58 +05:30
developers_projects.yml fix test_find_in_association_with_options test, tweak other tests affected by developer/project addition 2006-03-16 03:24:40 +00:00
developers.yml Ensure HABTM relationships produce valid class names (Fixes #17119) 2014-11-09 11:56:07 -06:00
dog_lovers.yml Update other counter caches on destroy 2013-03-20 13:43:07 -07:00
dogs.yml Update other counter caches on destroy 2013-03-20 13:43:07 -07:00
doubloons.yml Fix crash when loading fixture with belongs_to association defined in abstract base class. 2015-06-04 12:38:00 -04:00
edges.yml Revert "Revert "Assert primary key does not exist in habtm when the association is defined, instead of doing that everytime a record is inserted."" 2009-11-23 10:42:32 -08:00
encrypted_book_that_ignores_cases.yml Remove fixed "id" in encrypted book fixtures 2021-04-13 08:55:44 -04:00
encrypted_books.yml Remove fixed "id" in encrypted book fixtures 2021-04-13 08:55:44 -04:00
entrants.yml Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones. 2005-01-01 19:22:16 +00:00
essays.yml Replace test Man with Human 2020-08-14 11:37:09 -04:00
faces.yml Replace test Man with Human 2020-08-14 11:37:09 -04:00
fk_object_to_point_to.yml Verify foreign keys after loading fixtures 2021-07-07 15:41:05 -05:00
fk_test_has_fk.yml Fixed that fixtures were being deleted in the same order as inserts causing FK errors #890 [andrew.john.peters@gmail.com] 2005-04-18 07:52:58 +00:00
fk_test_has_pk.yml fk: use random digest names 2014-06-26 22:03:49 +02:00
friendships.yml Refactor Person/Friendship relationships to be more intuitive 2013-03-17 02:11:19 -04:00
funny_jokes.yml Fixtures: correct escaping of \n and \r. Closes #5859. 2006-08-24 01:50:24 +00:00
humans.yml Replace test Man with Human 2020-08-14 11:37:09 -04:00
interests.yml Replace test Man with Human 2020-08-14 11:37:09 -04:00
items.yml Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
jobs.yml Ensure table names are quoted by the association preloading code. 2008-04-26 12:14:50 +12:00
legacy_things.yml allow the 'lock_version' column to be configured with set_locking_column. Closes #3402 2006-01-14 09:36:52 +00:00
live_parrots.yml Fixes #18492 2015-01-14 21:36:58 +05:30
mateys.yml Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
member_details.yml Adding test_has_many_through_has_one_with_has_many_through_source_reflection and modifying ThroughAssociationScope to make it work correctly. 2010-10-12 17:27:10 +01:00
member_types.yml Fix preloading of has_one :through associations on belongs_to [#1507 state:resolved] 2008-12-18 19:19:36 +00:00
members.yml If a has_many goes :through a belongs_to, and the foreign key of the belongs_to changes, then the has_many should be considered stale. 2010-12-23 15:19:18 -08:00
memberships.yml chore: fix spelling change favourite to the more used favorite 2021-04-12 12:35:12 +10:00
minimalistics.yml Bring back ability to insert zero value on primary key for fixtures (#31795) 2018-01-26 12:42:28 +09:00
minivans.yml update_attribute should not update readonly attributes 2010-07-21 14:55:57 +02:00
mixed_case_monkeys.yml Consistently quote primary key column names. Closes #7763. 2007-03-09 03:23:37 +00:00
mixins.yml Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
movies.yml Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones. 2005-01-01 19:22:16 +00:00
nodes.yml Add pending test for the great-grandparent touching bug from #19324 2015-06-25 14:23:06 +02:00
organizations.yml Revert "Fixed bug with polymorphic has_one :as pointing to an STI record" 2009-05-11 12:20:54 -07:00
other_books.yml Allow specify fixtures to be ignored 2019-07-27 16:40:16 +08:00
other_comments.yml Merge pull request #20574 from repinel/fix-db-fixtures-load 2015-09-30 11:06:41 +02:00
other_dogs.yml fix #create_fixtures when equal table names in different databases 2016-12-21 11:09:29 +01:00
other_posts.yml Resolve attribute alias for counter cache column 2020-07-06 12:06:01 +09:00
other_topics.yml Fix a fixtures test case with table prefix/suffix 2011-12-27 02:17:31 +01:00
owners.yml Extend ActiveRecord::Base#cache_key to take an optional list of timestamp attributes of which the highest will be used. 2013-11-02 16:05:19 -07:00
parrots_pirates.yml Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
parrots.yml Don't like to add extra models/tables/fixtures, use existing those 2021-02-25 11:32:44 +09:00
people.yml Refactor Person/Friendship relationships to be more intuitive 2013-03-17 02:11:19 -04:00
peoples_treasures.yml Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
pets.yml has_many through obeys order on through association 2013-04-04 15:45:13 -04:00
pirates.yml Fix lookup of fixtures with non-string label 2015-01-06 17:15:39 +05:30
posts.yml Resolve attribute alias for counter cache column 2020-07-06 12:06:01 +09:00
price_estimates.yml Fixed where for polymorphic associations when passed an array containing different types. 2016-02-16 10:41:26 -08:00
products.yml Refactor compute_type to handle situations where the correct class is already loaded 2010-04-12 21:31:20 -07:00
projects.yml Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones. 2005-01-01 19:22:16 +00:00
randomly_named_a9.yml Test fixtures with custom model and table names 2011-12-30 10:34:01 +01:00
ratings.yml Revert "Merge pull request #14544 from jefflai2/named_scope_sti" 2014-05-21 12:15:57 -03:00
readers.yml Fix through association with source/through scope which has joins 2020-05-22 04:05:27 +09:00
references.yml chore: fix spelling change favourite to the more used favorite 2021-04-12 12:35:12 +10:00
ships.yml has_one should always remove the old record (properly), even if not saving the new record, so we don't get the database into a pickle 2011-01-11 13:45:06 -08:00
speedometers.yml If a has_many goes :through a belongs_to, and the foreign key of the belongs_to changes, then the has_many should be considered stale. 2010-12-23 15:19:18 -08:00
sponsors.yml Can preload associations through polymorphic associations 2018-04-20 17:28:25 -04:00
strict_zines.yml Ignore strict loading violations on instances loaded through fixtures 2020-12-10 15:23:14 -06:00
string_key_objects.yml Don't quote ID's as Arel will quote them -- follow same conventions as the delete method. 2011-05-08 18:37:28 +01:00
subscribers.yml Correct spelling 2017-02-05 19:00:18 -06:00
subscriptions.yml test and fix collection_singular_ids= with string primary keys [#5125 state:resolved] 2010-08-02 16:41:20 +02:00
taggings.yml Add a test for STI on the through where the through is nested, and change the code which support this 2011-03-05 20:10:24 +00:00
tags.yml Properly support conditions on any of the reflections involved in a nested through association 2010-10-19 00:27:40 +01:00
tasks.yml Fix docs to replace http with https in activerecord [ci skip] 2019-08-26 22:34:33 +09:00
topics.yml Update test data which doesn't reflect expected usage 2014-06-12 15:33:25 -06:00
toys.yml has_many through obeys order on through association 2013-04-04 15:45:13 -04:00
traffic_lights.yml test case for serialize default values. 2013-03-07 17:26:35 +01:00
treasures.yml Add 'foxy' support for fixtures of polymorphic associations. Closes #10183 [jbarnette, David Lowenfels] 2007-11-20 21:53:22 +00:00
trees.yml Add pending test for the great-grandparent touching bug from #19324 2015-06-25 14:23:06 +02:00
uuid_children.yml Auto-generate stable fixture UUIDs on PostgreSQL. 2014-01-07 19:05:50 +01:00
uuid_parents.yml Auto-generate stable fixture UUIDs on PostgreSQL. 2014-01-07 19:05:50 +01:00
variants.yml Refactor compute_type to handle situations where the correct class is already loaded 2010-04-12 21:31:20 -07:00
vegetables.yml rewrite inheritance tests with a custom inheritance_column 2012-09-03 20:30:43 +02:00
vertices.yml Included associations: go deep. 2006-08-16 18:10:52 +00:00
warehouse-things.yml More thoroughly quote table names. Exposes some issues with sqlite2 adapter. Closes #10698. 2008-01-05 14:58:28 +00:00
zines.yml Providing support for :inverse_of as an option to associations. 2009-05-04 15:27:39 -07:00