Revise documentation example wording - ActiveRecord::Relation#find_or_create_by [ci skip] #42443
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Updating the wording of the example to clarify the meaning and to match the wording of the previous paragraph.
Other Information
I know this is only one word, but I feel that this wording change is important as this confused me when I was reading the documentation for
find_or_create_by
for the first time. The worddifferent
used to describe this example implies either that there will be some sort of comparison to other users, or that the last name of the created record'slast_name
is different from the former version of the example, or that the last name used in this alternative example is different from the one used in its former counterpart, none of which are true.In reality, the following is possible:
I believe that this wording change more accurately and clearly reflects the actual functionality of
find_or_create_by
and would better aid others such as myself in reading the documentation going forward. I feel that using the wording from the previous example again here will improve the documentation forfind_or_create_by
.