diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-05-02 16:36:17 -0500 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-05-02 16:36:17 -0500 |
commit | 98264a1343fad6bb6637893a37fd571916b4158c (patch) | |
tree | bd92269be100b52382e69a485f9675c1fa6fda7f /activerecord/lib | |
parent | e0a9baa044022eea52b8c4b36689396dac165944 (diff) | |
download | rails-98264a1343fad6bb6637893a37fd571916b4158c.tar.gz rails-98264a1343fad6bb6637893a37fd571916b4158c.tar.bz2 rails-98264a1343fad6bb6637893a37fd571916b4158c.zip |
Do not delegate `AR::Base#empty?` to `all`
Unlike `one?` and `none?`, `empty?` has interactions with methods
outside of enumerable. It also doesn't fit in the same vein.
`Topic.any?` makes sense. `Topic.empty?` does not, as `Topic` is not a
container.
Fixes #24808
Close #24812
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/querying.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb index 4e32d73001..53ddd95bb0 100644 --- a/activerecord/lib/active_record/querying.rb +++ b/activerecord/lib/active_record/querying.rb @@ -1,6 +1,6 @@ module ActiveRecord module Querying - delegate :find, :take, :take!, :first, :first!, :last, :last!, :exists?, :any?, :many?, :empty?, :none?, :one?, to: :all + delegate :find, :take, :take!, :first, :first!, :last, :last!, :exists?, :any?, :many?, :none?, :one?, to: :all delegate :second, :second!, :third, :third!, :fourth, :fourth!, :fifth, :fifth!, :forty_two, :forty_two!, :third_to_last, :third_to_last!, :second_to_last, :second_to_last!, to: :all delegate :first_or_create, :first_or_create!, :first_or_initialize, to: :all delegate :find_or_create_by, :find_or_create_by!, :find_or_initialize_by, to: :all |