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
Jon Leighton c8d889905d Prevent Relation#merge from collapsing wheres on the RHS
This caused a bug with the new associations implementation, because now
association conditions are represented as Arel nodes internally right up
to when the whole thing gets turned to SQL.

In Rails 3.2, association conditions get turned to raw SQL early on,
which prevents Relation#merge from interfering.

The current implementation was buggy when a default_scope existed on the
target model, since we would basically end up doing:

  default_scope.merge(association_scope)

If default_scope contained a where(foo: 'a') and association_scope
contained a where(foo: 'b').where(foo: 'c') then the merger would see
that the same column is representated on both sides of the merge and
collapse the wheres to all but the last: where(foo: 'c')

Now, the RHS of the merge is left alone.

Fixes #8990
2013-01-27 20:34:52 +00: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 deprecating CSV fixture support 2011-05-10 11:08:18 -07:00
categories
naked
reserved_words Improve the derivation of HABTM assocation join table names 2012-06-22 06:27:11 +01:00
.gitignore
accounts.yml
author_addresses.yml
author_favorites.yml
authors.yml
binaries.yml
books.yml
cars.yml
categories.yml
categories_ordered.yml fixing 1.8 support for new fixture tests 2011-05-23 15:06:13 -07:00
categories_posts.yml
categorizations.yml
clubs.yml
collections.yml
colleges.yml added test for #3732 2012-02-10 17:35:22 -05:00
comments.yml
companies.yml test cleanup, remove ruby_type because it's no longer needed 2012-09-03 20:38:14 +02:00
computers.yml
courses.yml added test for #3732 2012-02-10 17:35:22 -05:00
customers.yml
dashboards.yml
developers.yml Replaced all 'for' loops with Enumerable#each 2012-01-30 03:15:49 +08:00
developers_projects.yml
dog_lovers.yml Fix bug where reset_counters resets the wrong counter cache. 2012-01-16 19:06:45 -08:00
dogs.yml Fix bug where reset_counters resets the wrong counter cache. 2012-01-16 19:06:45 -08:00
edges.yml
entrants.yml
essays.yml
faces.yml
fk_test_has_fk.yml
fk_test_has_pk.yml
friendships.yml reset_counters() was crashing when there were multiple belongs_to associations with the same foreign key. 2012-08-21 14:10:11 -03:00
funny_jokes.yml
interests.yml
items.yml
jobs.yml
legacy_things.yml
mateys.yml Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
member_details.yml
member_types.yml
members.yml
memberships.yml Don't use select() values from the join model of a through association. Fixes #508. 2011-05-11 08:56:01 +01:00
men.yml
minimalistics.yml
minivans.yml
mixed_case_monkeys.yml
mixins.yml
movies.yml
organizations.yml
other_topics.yml Fix a fixtures test case with table prefix/suffix 2011-12-27 02:17:31 +01:00
owners.yml
parrots.yml properly reference yml alias nodes 2011-05-24 11:18:28 +02:00
parrots_pirates.yml Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
people.yml reset_counters() was crashing when there were multiple belongs_to associations with the same foreign key. 2012-08-21 14:10:11 -03:00
peoples_treasures.yml Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
pets.yml
pirates.yml Quote these dates to prevent intermittent test failure. Suppose local time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved. 2011-08-04 00:38:27 +01:00
posts.yml Merge branch 'master' into nested_has_many_through 2011-03-04 09:30:27 +00:00
price_estimates.yml
products.yml
projects.yml
randomly_named_a9.yml Test fixtures with custom model and table names 2011-12-30 10:34:01 +01:00
ratings.yml
readers.yml Prevent Relation#merge from collapsing wheres on the RHS 2013-01-27 20:34:52 +00:00
references.yml
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
sponsors.yml
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
subscriptions.yml
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
tasks.yml restores the API docs of AR::Fixtures, made a quick pass over them, revises link in fixture template [closes #2840] 2011-09-03 15:20:30 -07:00
teapots.yml Fixtures support for ActiveRecord::Model 2011-12-24 11:08:15 +00:00
topics.yml Fix occasional microsecond conversion inaccuracy 2012-08-15 13:21:57 -04:00
toys.yml
traffic_lights.yml Make serialized fixtures work again 2010-12-29 16:15:45 +00:00
treasures.yml
variants.yml
vegetables.yml rewrite inheritance tests with a custom inheritance_column 2012-09-03 20:30:43 +02:00
vertices.yml
warehouse-things.yml
zines.yml