aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2014-06-23 11:42:46 +0800
committerSean Griffin <sean@thoughtbot.com>2015-01-28 13:35:55 -0700
commitb0b37942d729b6bdcd2e3178eda7fa1de203b3d0 (patch)
treecbf5e9fe861b6093166213b322e3d5f6bf0c8156 /activerecord/CHANGELOG.md
parent56a3d5ec9183a9bcbf140d4102d45e3928f2617a (diff)
downloadrails-b0b37942d729b6bdcd2e3178eda7fa1de203b3d0.tar.gz
rails-b0b37942d729b6bdcd2e3178eda7fa1de203b3d0.tar.bz2
rails-b0b37942d729b6bdcd2e3178eda7fa1de203b3d0.zip
Added #or to ActiveRecord::Relation
Post.where('id = 1').or(Post.where('id = 2')) # => SELECT * FROM posts WHERE (id = 1) OR (id = 2) [Matthew Draper & Gael Muller]
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index c0ebb892aa..73dfc1d647 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,13 @@
+* Added the `#or` method on ActiveRecord::Relation, allowing use of the OR
+ operator to combine WHERE or HAVING clauses.
+
+ Example:
+
+ Post.where('id = 1').or(Post.where('id = 2'))
+ # => SELECT * FROM posts WHERE (id = 1) OR (id = 2)
+
+ *Sean Griffin*, *Matthew Draper*, *Gael Muller*, *Olivier El Mekki*
+
* Don't define autosave association callbacks twice from
`accepts_nested_attributes_for`.