aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2019-02-26 12:47:27 -0800
committerGitHub <noreply@github.com>2019-02-26 12:47:27 -0800
commit55a7051a5a2935c0ced79afc5c81ef7db9e0dd73 (patch)
treec2deb2905a5887641b953474125ecf74395c4c7b /activerecord/CHANGELOG.md
parent3ee0dabb8443c636bf3b51ef051b4b94ee2af460 (diff)
downloadrails-55a7051a5a2935c0ced79afc5c81ef7db9e0dd73.tar.gz
rails-55a7051a5a2935c0ced79afc5c81ef7db9e0dd73.tar.bz2
rails-55a7051a5a2935c0ced79afc5c81ef7db9e0dd73.zip
Add negative scopes for all enum values (#35381)
Add negative scopes for all enum values
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 4323c57b9e..ce1f1102d5 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,17 @@
+* Add negative scopes for all enum values.
+
+ Example:
+
+ class Post < ActiveRecord::Base
+ enum status: %i[ drafted active trashed ]
+ end
+
+ Post.not_drafted # => where.not(status: :drafted)
+ Post.not_active # => where.not(status: :active)
+ Post.not_trashed # => where.not(status: :trashed)
+
+ *DHH*
+
* Fix different `count` calculation when using `size` with manual `select` with DISTINCT.
Fixes #35214.