aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-02-11 23:23:01 -0500
committerwangjohn <wangjohn@mit.edu>2013-03-03 20:42:01 -0500
commit293875457bc5b0fccbf3e64bcd275cdac252f98c (patch)
tree5f8385454788673ac00004cd9c494b5df02d3cfc /activerecord/CHANGELOG.md
parent9ee6f3cc8ef1cd50648ec2882803943d3bd1f24a (diff)
downloadrails-293875457bc5b0fccbf3e64bcd275cdac252f98c.tar.gz
rails-293875457bc5b0fccbf3e64bcd275cdac252f98c.tar.bz2
rails-293875457bc5b0fccbf3e64bcd275cdac252f98c.zip
Created an unscope method for removing relations from a chain of
relations. Specific where values can be unscoped, and the unscope method still works when relations are merged or combined.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 2eaf388095..d265f04562 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,21 @@
## Rails 4.0.0 (unreleased) ##
+* Added functionality to unscope relations in a relations chain. For
+ instance, if you are passed in a chain of relations as follows:
+
+ Posts.select(:name => "John").order('id DESC')
+
+ but you want to get rid of order, then this feature allows you to do:
+
+ Posts.select(:name => "John").order("id DESC").unscope(:order)
+ == Posts.select(:name => "John")
+
+ The .unscope() function is more general than the .except() method because
+ .except() only works on the relation it is acting on. However, .unscope()
+ works for any relation in the entire relation chain.
+
+ *John Wang*
+
* Postgresql timestamp with time zone (timestamptz) datatype now returns a
ActiveSupport::TimeWithZone instance instead of a string