Skip to content

Commit 4dc8668

Browse files
committed
Correct error in the document for query_constraints [ci-skip]
The context of this example suggests what it really wants to point to is `query_constraints` instead of `query_by`. Also apply fixed-width font to the reference to the methods correctly.
1 parent 4332988 commit 4dc8668

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/persistence.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def update!(id = :all, attributes)
456456
end
457457

458458
# Accepts a list of attribute names to be used in the WHERE clause
459-
# of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for `#first` and `#last` finder methods.
459+
# of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for +#first+ and +#last+ finder methods.
460460
#
461461
# class Developer < ActiveRecord::Base
462462
# query_constraints :company_id, :id
@@ -469,7 +469,7 @@ def update!(id = :all, attributes)
469469
# developer.update!(name: "Nikita")
470470
# # UPDATE "developers" SET "name" = 'Nikita' WHERE "developers"."company_id" = 1 AND "developers"."id" = 1
471471
#
472-
# It is possible to update attribute used in the query_by clause:
472+
# # It is possible to update an attribute used in the query_constraints clause:
473473
# developer.update!(company_id: 2)
474474
# # UPDATE "developers" SET "company_id" = 2 WHERE "developers"."company_id" = 1 AND "developers"."id" = 1
475475
#

0 commit comments

Comments
 (0)