diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2013-01-09 01:04:15 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2013-01-09 01:04:15 +0530 |
commit | f049016cd348627bf8db0d72382d7580bf802a79 (patch) | |
tree | bfae05fc707ae5529b60dbe10bfd5891dab8de73 /guides/source/active_record_querying.md | |
parent | 64e3660ff0c0fd708fd4fc5455c54bf3d511032b (diff) | |
parent | cab6ba4e1bf2abf6a5fb83f2f28e2a8482350bbd (diff) | |
download | rails-f049016cd348627bf8db0d72382d7580bf802a79.tar.gz rails-f049016cd348627bf8db0d72382d7580bf802a79.tar.bz2 rails-f049016cd348627bf8db0d72382d7580bf802a79.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
guides/source/getting_started.md
Diffstat (limited to 'guides/source/active_record_querying.md')
-rw-r--r-- | guides/source/active_record_querying.md | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 24f98f68ca..62d6294ae5 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -1228,9 +1228,7 @@ Client.unscoped { Dynamic Finders --------------- -For every field (also known as an attribute) you define in your table, Active Record provides a finder method. If you have a field called `first_name` on your `Client` model for example, you get `find_by_first_name` and `find_all_by_first_name` for free from Active Record. If you have a `locked` field on the `Client` model, you also get `find_by_locked` and `find_all_by_locked` methods. - -You can also use `find_last_by_*` methods which will find the last record matching your argument. +For every field (also known as an attribute) you define in your table, Active Record provides a finder method. If you have a field called `first_name` on your `Client` model for example, you get `find_by_first_name` for free from Active Record. If you have a `locked` field on the `Client` model, you also get `find_by_locked` and methods. You can specify an exclamation point (`!`) on the end of the dynamic finders to get them to raise an `ActiveRecord::RecordNotFound` error if they do not return any records, like `Client.find_by_name!("Ryan")` |