Skip to content

Commit 4335bc9

Browse files
committed
simplify in_order_of documentation
1 parent 178b5da commit 4335bc9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

activerecord/lib/active_record/relation/query_methods.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ def order!(*args) # :nodoc:
606606
self
607607
end
608608

609-
# Allows to specify an <code>ORDER BY</code> clause to a query based on a given +column+,
610-
# ordered and filtered by the specific set of +values+.
609+
# Applies an <tt>ORDER BY</tt> clause based on a given +column+,
610+
# ordered and filtered by a specific set of +values+.
611611
#
612612
# User.in_order_of(:id, [1, 5, 3])
613613
# # SELECT "users".* FROM "users"
@@ -625,7 +625,7 @@ def order!(*args) # :nodoc:
625625
# enum :status, [ :active, :archived ]
626626
# end
627627
#
628-
# Conversation.in_order_of(:status, %w(archived active))
628+
# Conversation.in_order_of(:status, [:archived, :active])
629629
# # SELECT "conversations".* FROM "conversations"
630630
# # WHERE "conversations"."status" IN (1, 0)
631631
# # ORDER BY CASE
@@ -635,7 +635,7 @@ def order!(*args) # :nodoc:
635635
#
636636
# +values+ can also include +nil+.
637637
#
638-
# Conversation.in_order_of(:status, %w(nil archived active))
638+
# Conversation.in_order_of(:status, [nil, :archived, :active])
639639
# # SELECT "conversations".* FROM "conversations"
640640
# # WHERE ("conversations"."status" IN (1, 0) OR "conversations"."status" IS NULL)
641641
# # ORDER BY CASE

0 commit comments

Comments
 (0)