From 4335bc9c3155779a66cf98342e7187bd7a41882e Mon Sep 17 00:00:00 2001 From: Thiago Araujo Date: Wed, 31 Jan 2024 08:45:39 -0700 Subject: [PATCH] simplify `in_order_of` documentation --- activerecord/lib/active_record/relation/query_methods.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 79c2c9e400f58..4fdcc93a4c873 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -606,8 +606,8 @@ def order!(*args) # :nodoc: self end - # Allows to specify an ORDER BY clause to a query based on a given +column+, - # ordered and filtered by the specific set of +values+. + # Applies an ORDER BY clause based on a given +column+, + # ordered and filtered by a specific set of +values+. # # User.in_order_of(:id, [1, 5, 3]) # # SELECT "users".* FROM "users" @@ -625,7 +625,7 @@ def order!(*args) # :nodoc: # enum :status, [ :active, :archived ] # end # - # Conversation.in_order_of(:status, %w(archived active)) + # Conversation.in_order_of(:status, [:archived, :active]) # # SELECT "conversations".* FROM "conversations" # # WHERE "conversations"."status" IN (1, 0) # # ORDER BY CASE @@ -635,7 +635,7 @@ def order!(*args) # :nodoc: # # +values+ can also include +nil+. # - # Conversation.in_order_of(:status, %w(nil archived active)) + # Conversation.in_order_of(:status, [nil, :archived, :active]) # # SELECT "conversations".* FROM "conversations" # # WHERE ("conversations"."status" IN (1, 0) OR "conversations"."status" IS NULL) # # ORDER BY CASE