rails--rails/activerecord/test/schema
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
..
mysql2_specific_schema.rb Use the MySQL varbinary type when appropriate in migrations. 2012-10-27 13:41:27 -04:00
mysql_specific_schema.rb Use the MySQL varbinary type when appropriate in migrations. 2012-10-27 13:41:27 -04:00
oracle_specific_schema.rb added additional objects necessary for OracleAdapter specific tests 2009-08-06 23:40:59 +03:00
postgresql_specific_schema.rb Fix PostgreSQL tests on Travis 2013-01-24 00:16:01 +00:00
schema.rb Prevent Relation#merge from collapsing wheres on the RHS 2013-01-27 20:34:52 +00:00
sqlite_specific_schema.rb mispelling errors in render_text_test.rb and sqlite_specific_schema 2012-05-12 13:19:28 +02:00