mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix typo
This commit is contained in:
parent
14bd328273
commit
e71d09bf82
1 changed files with 1 additions and 1 deletions
|
@ -1609,7 +1609,7 @@ you get the instance method `find_by_first_name` for free from Active Record.
|
|||
If you also have a `locked` field on the `Customer` model, you also get `find_by_locked` method.
|
||||
|
||||
You can specify an exclamation point (`!`) on the end of the dynamic finders
|
||||
gto get them to raise an `ActiveRecord::RecordNotFound` error if they do not return any records, like `Customer.find_by_name!("Ryan")`
|
||||
to get them to raise an `ActiveRecord::RecordNotFound` error if they do not return any records, like `Customer.find_by_name!("Ryan")`
|
||||
|
||||
If you want to find both by `name` and `orders_count`, you can chain these finders together by simply typing "`and`" between the fields.
|
||||
For example, `Customer.find_by_first_name_and_orders_count("Ryan", 5)`.
|
||||
|
|
Loading…
Reference in a new issue