aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 9e22be1b94..c6a6e44724 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,31 @@
## Rails 4.0.0 (unreleased) ##
+* Relation#merge now only overwrites where values on the LHS of the
+ merge. Consider:
+
+ left = Person.where(age: [13, 14, 15])
+ right = Person.where(age: [13, 14]).where(age: [14, 15])
+
+ `left` results in the following SQL:
+
+ WHERE age IN (13, 14, 15)
+
+ `right` results in the following SQL:
+
+ WHERE age IN (13, 14) AND age IN (14, 15)
+
+ Previously, `left.merge(right)` would result in all but the last
+ condition being removed:
+
+ WHERE age IN (14, 15)
+
+ Now it results in the LHS condition(s) for `age` being removed, but
+ the RHS remains as it is:
+
+ WHERE age IN (13, 14) AND age IN (14, 15)
+
+ *Jon Leighton*
+
* Fix handling of dirty time zone aware attributes
Previously, when `time_zone_aware_attributes` were enabled, after