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
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
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
config.example.yml Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests. 2012-07-16 09:55:20 -07:00
config.rb