aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2013-04-05 05:57:27 -0700
committerJon Leighton <j@jonathanleighton.com>2013-04-05 05:57:27 -0700
commit685cf144a9b7171160d6ac71da993349d1b0eda8 (patch)
tree6ebd80481a4f47de75181aaa657748c223910507 /activerecord/CHANGELOG.md
parentbab0e2804d1c061bf639e2fb01ffc27b9e98384e (diff)
parent448381593edf0b87e3afd4945bd13650a7483b17 (diff)
downloadrails-685cf144a9b7171160d6ac71da993349d1b0eda8.tar.gz
rails-685cf144a9b7171160d6ac71da993349d1b0eda8.tar.bz2
rails-685cf144a9b7171160d6ac71da993349d1b0eda8.zip
Merge pull request #9996 from mikz/master
Association with inverse_of does not set the parent in association building block
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 0dcc7a4819..db9aa858c2 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -418,6 +418,23 @@
# This will expand the order :name to "authors".name.
Author.joins(:books).where('books.published = 1').order(:name)
+* Fix associations with `:inverse_of` option when building association
+ with a block. Inside the block the parent object was different then
+ after the block.
+
+ Example:
+
+ parent.association.build do |child|
+ child.parent.equal?(parent) # false
+ end
+
+ # vs
+
+ child = parent.association.build
+ child.parent.equal?(parent) # true
+
+ *Michal Cichra*
+
## Rails 4.0.0.beta1 (February 25, 2013) ##