rails/activeresource — pull request #88 by rfletcher (2013-08-03 21:49:58+00:00)
Title: Exception on 404 with .find(:first), .find(:last)

If a collection API returns a 404 when calling .find(:first) or .find(:last), it causes an exception. Here's my original test script:

```ruby
require "active_resource"
require "webmock"

include WebMock::API

stub_request( :any, "api.example.com/people.json" ).to_return( :status => 404 )

class Person < ActiveResource::Base
self.site = "http://api.example.com"
end

Person.find( :one )
````

```
activeresource-4.0.0/lib/active_resource/base.rb:874:in `find': undefined method `first' for nil:NilClass (NoMethodError)
```