From 59b93dfda7def9e949f700fdb4d71885a1b17f59 Mon Sep 17 00:00:00 2001 From: Juanito Fatas Date: Wed, 16 Jul 2014 23:12:13 +0800 Subject: [ci skip] Remove duplicated last! section. Reference: https://github.com/rails/rails/commit/d4fd0bd17709735ac91e434c94fe99429f078c6e cc @schneems --- guides/source/active_record_querying.md | 17 ----------------- 1 file changed, 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! -# => # -``` - -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. -- cgit v1.2.3