diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-04 16:10:18 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-05 16:22:18 +0000 |
commit | 562583c7667f508493ab8c5b1a4215087fafd22d (patch) | |
tree | d61a983ca8e5b9d38164f34d1eb6c36b0f822be8 /activerecord/CHANGELOG.md | |
parent | 6aaae3de277b572f37e09f16ae12737c3c87dfb7 (diff) | |
download | rails-562583c7667f508493ab8c5b1a4215087fafd22d.tar.gz rails-562583c7667f508493ab8c5b1a4215087fafd22d.tar.bz2 rails-562583c7667f508493ab8c5b1a4215087fafd22d.zip |
Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 426f6b48b3..2524082062 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,21 @@ ## Rails 3.2.0 (unreleased) ## +* Add ActiveRecord::Relation#uniq for generating unique queries. + + Before: + + Client.select('DISTINCT name') + + After: + + Client.select(:name).uniq + + This also allows you to revert the unqueness in a relation: + + Client.select(:name).uniq.uniq(false) + + *Jon Leighton* + * Support index sort order in sqlite, mysql and postgres adapters. *Vlad Jebelev* * Allow the :class_name option for associations to take a symbol (:Client) in addition to |