From 55a7051a5a2935c0ced79afc5c81ef7db9e0dd73 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 26 Feb 2019 12:47:27 -0800 Subject: Add negative scopes for all enum values (#35381) Add negative scopes for all enum values --- activerecord/CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'activerecord/CHANGELOG.md') 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. -- cgit v1.2.3