diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-07 16:52:55 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-07 16:52:55 -0200 |
commit | 8d02afeaee8993bd0fde69687fdd9bf30921e805 (patch) | |
tree | 93cfbc3e5b18379c69abe6befa2bb3e78e542e86 /activerecord/CHANGELOG.md | |
parent | 7b50dc5316f1db83b2d138a12bb0b0ab5ea90a33 (diff) | |
download | rails-8d02afeaee8993bd0fde69687fdd9bf30921e805.tar.gz rails-8d02afeaee8993bd0fde69687fdd9bf30921e805.tar.bz2 rails-8d02afeaee8993bd0fde69687fdd9bf30921e805.zip |
Rollback where.like and where.not_like
The real win with these chain methods is where.not, that takes care of
different scenarios in a graceful way, for instance when the given value
is nil.
where("author.id != ?", author_to_ignore.id)
where.not("author.id", author_to_ignore.id)
Both where.like and where.not_like compared to the SQL versions doesn't
seem to give us that much:
Post.where("title LIKE 'ruby on%'")
Post.where.like(title: 'ruby on%'")
Post.where("title NOT LIKE 'ruby on%'")
Post.where.not_like(title: 'ruby on%'")
Thus Rails is adding where.not, but not where.like/not_like and others.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 9798f783c1..82266fe1d5 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,11 +1,10 @@ ## Rails 4.0.0 (unreleased) ## -* Allow `Relation#where` with no arguments to be chained with new query methods - `not`, `like`, and `not_like`. +* Allow `Relation#where` with no arguments to be chained with new `not` query method. Example: - Developer.where.not(name: 'Aaron').where.like(name: 'Takoyaki%') + Developer.where.not(name: 'Aaron') *Akira Matsuda* |