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
Carlos Antonio da Silva 694334c37a Fix issue with collection associations and first(n)/last(n)
When calling first(n) or last(n) in a collection, Active Record was
improperly trying to set the inverse of instance in case that option
existed. This change was introduced by
fdf4eae506.

In such cases we don't need to do that "manually", since the way
collection will be loaded will already handle that, so we just skip
setting the inverse association when any argument is given to
first(n)/last(n).

The test included ensures that these scenarios will have the inverse of
instance set properly.

Fixes #8087, Closes #8094.

Squashed cherry-pick from d37d40b and c368b66.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/collection_association.rb
2012-11-01 14:37:12 -02:00
..
active_record/connection_adapters Ensure disconnecting or reconnecting resets the transaction state 2012-09-15 00:03:04 +01:00
assets Added test to illustrate bad binary blobs. 2012-01-31 13:45:00 -06:00
cases Fix issue with collection associations and first(n)/last(n) 2012-11-01 14:37:12 -02:00
fixtures Rename "Fixtures" class to "FixtureSet" 2012-10-07 19:15:58 +02:00
migrations stop depending on the filesystem for interleaved migration tests 2012-01-13 14:33:59 -08:00
models Remove ActiveRecord::Model 2012-10-26 15:51:02 +01:00
schema Use the MySQL varbinary type when appropriate in migrations. 2012-10-27 13:41:27 -04:00
support Remove ActiveRecord::Model 2012-10-26 15:51:02 +01:00
.gitignore Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. 2011-06-04 23:47:03 +01:00
config.example.yml Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests. 2012-07-16 09:55:20 -07:00
config.rb