From 8309706239769c429bbd323ba4d36d8ef10bb2f1 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 7 Mar 2019 19:07:07 +0900 Subject: Delegate `only` query method to relation as with `except` I've found the skewness of delegation methods between `except` and `only` in a88b6f2. The `only` method is closely similar with `except` as `SpawnMethods`. https://github.com/rails/rails/blob/e056b9bfb07c4eb3bcc6672d885aadd72bec574f/activerecord/lib/active_record/relation/spawn_methods.rb#L53-L67 It is preferable both behaves the same way. --- activerecord/lib/active_record/querying.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb index 36e2134c46..7a8d0cb663 100644 --- a/activerecord/lib/active_record/querying.rb +++ b/activerecord/lib/active_record/querying.rb @@ -14,7 +14,7 @@ module ActiveRecord :find_each, :find_in_batches, :in_batches, :select, :reselect, :order, :reorder, :group, :limit, :offset, :joins, :left_joins, :left_outer_joins, :where, :rewhere, :preload, :eager_load, :includes, :from, :lock, :readonly, :extending, :or, - :having, :create_with, :distinct, :references, :none, :unscope, :merge, :except, + :having, :create_with, :distinct, :references, :none, :unscope, :merge, :except, :only, :count, :average, :minimum, :maximum, :sum, :calculate, :pluck, :pick, :ids ].freeze # :nodoc: -- cgit v1.2.3