aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2013-06-09 01:58:42 -0700
committerJon Leighton <j@jonathanleighton.com>2013-06-09 01:58:42 -0700
commitae6e6d953084d1966e52cc06ffe24131f0115cc1 (patch)
tree67f5b924096f4733980bab74c43ab92e437bca36 /activerecord/CHANGELOG.md
parent8b82387c97e60faff77c3db30e53abf2f94450d0 (diff)
parentd6b03a376787ec9c9e934e5688a38c576f2e39b7 (diff)
downloadrails-ae6e6d953084d1966e52cc06ffe24131f0115cc1.tar.gz
rails-ae6e6d953084d1966e52cc06ffe24131f0115cc1.tar.bz2
rails-ae6e6d953084d1966e52cc06ffe24131f0115cc1.zip
Merge pull request #10886 from wangjohn/chnges_for_automatic_inverse_associations
Documentation and cleanup of automatic discovery of inverse associations
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index e5312d7d7c..98033e904e 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,24 @@
+* Rails now automatically detects inverse associations. If you do not set the
+ `:inverse_of` option on the association, then Active Record will guess the
+ inverse association based on heuristics.
+
+ Note that automatic inverse detection only works on `has_many`, `has_one`,
+ and `belongs_to` associations. Extra options on the associations will
+ also prevent the association's inverse from being found automatically.
+
+ The automatic guessing of the inverse association uses a heuristic based
+ on the name of the class, so it may not work for all associations,
+ especially the ones with non-standard names.
+
+ You can turn off the automatic detection of inverse associations by setting
+ the `:inverse_of` option to `false` like so:
+
+ class Taggable < ActiveRecord::Base
+ belongs_to :tag, inverse_of: false
+ end
+
+ *John Wang*
+
* Fix `add_column` with `array` option when using PostgreSQL. Fixes #10432
*Adam Anderson*