diff options
author | Juanito Fatas <katehuang0320@gmail.com> | 2014-07-16 23:12:13 +0800 |
---|---|---|
committer | Juanito Fatas <katehuang0320@gmail.com> | 2014-07-16 23:12:13 +0800 |
commit | 59b93dfda7def9e949f700fdb4d71885a1b17f59 (patch) | |
tree | 405c2654fa2c6c5b1d2a6e40aabfa7d31ba8e82d /guides | |
parent | 758ae373055b977892db3673dcd4cae58cdc98a8 (diff) | |
download | rails-59b93dfda7def9e949f700fdb4d71885a1b17f59.tar.gz rails-59b93dfda7def9e949f700fdb4d71885a1b17f59.tar.bz2 rails-59b93dfda7def9e949f700fdb4d71885a1b17f59.zip |
[ci skip] Remove duplicated last! section.
Reference: https://github.com/rails/rails/commit/d4fd0bd17709735ac91e434c94fe99429f078c6e
cc @schneems
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_querying.md | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index a0a2f31a63..35467fe95b 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -267,23 +267,6 @@ This is equivalent to writing: Client.where(first_name: 'does not exist').take! ``` -#### `last!` - -`Model.last!` finds the last record ordered by the primary key. For example: - -```ruby -client = Client.last! -# => #<Client id: 221, first_name: "Russel"> -``` - -The SQL equivalent of the above is: - -```sql -SELECT * FROM clients ORDER BY clients.id DESC LIMIT 1 -``` - -`Model.last!` raises `ActiveRecord::RecordNotFound` if no matching record is found. - ### Retrieving Multiple Objects in Batches We often need to iterate over a large set of records, as when we send a newsletter to a large set of users, or when we export data. |