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
Philippe Huibonhoa 359adaedd9 Fixed where for polymorphic associations when passed an array containing different types.
When passing in an array of different types of objects to `where`, it would only take into account the class of the first object in the array.

    PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)])
	# => SELECT "price_estimates".* FROM "price_estimates"
         WHERE ("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" IN (1, 2))

This is fixed to properly look for any records matching both type and id:

    PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)])
    # => SELECT "price_estimates".* FROM "price_estimates"
         WHERE (("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" = 1)
         OR ("price_estimates"."estimate_of_type" = 'Car' AND "price_estimates"."estimate_of_id" = 2))
2016-02-16 10:41:26 -08:00
..
admin
all
categories
naked/yml fix regression when loading fixture files with symbol keys. 2016-01-13 10:11:54 +01:00
reserved_words
to_be_linked
.gitignore
accounts.yml
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
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
books.yml Fix spelling of Thoughtleadering 2015-07-02 15:48:47 -04:00
bulbs.yml make it possible to access fixtures excluded by a default_scope. 2014-11-21 14:57:25 +01:00
cars.yml
categories.yml
categories_ordered.yml
categories_posts.yml
categorizations.yml
clubs.yml
collections.yml
colleges.yml
comments.yml
companies.yml Ensure AR #second, #third, etc. finders work through associations 2014-01-21 19:35:27 -05:00
computers.yml Ensure HABTM relationships produce valid class names (Fixes #17119) 2014-11-09 11:56:07 -06:00
content.yml Add support for bidirectional destroy dependencies 2015-01-16 11:41:43 +00:00
content_positions.yml Add support for bidirectional destroy dependencies 2015-01-16 11:41:43 +00:00
courses.yml
customers.yml
dashboards.yml
dead_parrots.yml Fixes #18492 2015-01-14 21:36:58 +05:30
developers.yml Ensure HABTM relationships produce valid class names (Fixes #17119) 2014-11-09 11:56:07 -06:00
developers_projects.yml
dog_lovers.yml
dogs.yml
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
entrants.yml
essays.yml
faces.yml
fk_test_has_fk.yml
fk_test_has_pk.yml fk: use random digest names 2014-06-26 22:03:49 +02:00
friendships.yml
funny_jokes.yml
interests.yml
items.yml
jobs.yml
legacy_things.yml
live_parrots.yml Fixes #18492 2015-01-14 21:36:58 +05:30
mateys.yml
member_details.yml
member_types.yml
members.yml
memberships.yml
men.yml
minimalistics.yml
minivans.yml
mixed_case_monkeys.yml
mixins.yml
movies.yml
nodes.yml Add pending test for the great-grandparent touching bug from #19324 2015-06-25 14:23:06 +02:00
organizations.yml
other_comments.yml Merge pull request #20574 from repinel/fix-db-fixtures-load 2015-09-30 11:06:41 +02:00
other_posts.yml Merge pull request #20574 from repinel/fix-db-fixtures-load 2015-09-30 11:06:41 +02:00
other_topics.yml
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.yml
parrots_pirates.yml
people.yml
peoples_treasures.yml
pets.yml
pirates.yml Fix lookup of fixtures with non-string label 2015-01-06 17:15:39 +05:30
posts.yml Deprecate automatic counter caches on has_many :through 2014-06-26 07:24:34 -06: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
projects.yml
randomly_named_a9.yml
ratings.yml Revert "Merge pull request #14544 from jefflai2/named_scope_sti" 2014-05-21 12:15:57 -03:00
readers.yml
references.yml
ships.yml
speedometers.yml
sponsors.yml we should have unique sponsorable ids in the fixtures at least 2013-10-14 15:27:49 -07:00
string_key_objects.yml
subscribers.yml
subscriptions.yml
taggings.yml
tags.yml
tasks.yml
teapots.yml
topics.yml Update test data which doesn't reflect expected usage 2014-06-12 15:33:25 -06:00
toys.yml
traffic_lights.yml
treasures.yml
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
vegetables.yml
vertices.yml
warehouse-things.yml
zines.yml