Skip to content

Commit

Permalink
simplify in_order_of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thdaraujo committed Jan 31, 2024
1 parent 178b5da commit 4335bc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/lib/active_record/relation/query_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ def order!(*args) # :nodoc:
self
end

# Allows to specify an <code>ORDER BY</code> clause to a query based on a given +column+,
# ordered and filtered by the specific set of +values+.
# Applies an <tt>ORDER BY</tt> 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"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4335bc9

Please sign in to comment.