Commit Graph

3 Commits

Author SHA1 Message Date
taryn ce61a6bd55 Added first/last/all aliases for equivalent find scopes
Just a copy from Active Record (with tests). Each is a warpper function for
the equivalent scoped call to find eg first is a wrapper for find(:first)

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-21 14:49:59 -05:00
taryn 4dc05bc8a9 Swallow ResourceNotFound error on find_every
Active Record does not explode with RecordNotFound if you go looking for a
collection of objects - it just returns nil. Thus Active Resource should
also not explode.

After all - finding no objects that match a set of conditions is not
exceptional behaviour - unlike looking for a specific object with a given id
(which you'd expect to exist).

I've also added documentation to +find+ to reflect this.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:04:48 -05:00
taryn 079ed8fc43 Pulled find-based tests into their own test case. This matches Active Record, and allows us to have one places where all find-tests are located, which will help when adding dynamic finders later.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:04:14 -05:00