@user = User.find(:first, :from => :email, :params => {:email =>
'foo@bar'})
If the find returns nil what is supposed to happen? I'd really like
to get nil to the caller. What's best practice in this case?
Henry
>
> Is this what you mean?
No.
As far as I can tell from reading (don't have time to mock it up sorry), if
it can't find anything, The server is meant to return a 404 error, which
activeresource interprets as "throw a ResourceNotFound exception"
If that is the case you would have to rescue/return nil wouldn't you?
>
> Wow, activeresource has really changed since I last looked (before
> they
> pulled it from the 1.2 release)
>
> As far as I can tell from reading (don't have time to mock it up
> sorry), if
> it can't find anything, The server is meant to return a 404 error,
> which
> activeresource interprets as "throw a ResourceNotFound exception"
>
> If that is the case you would have to rescue/return nil wouldn't you?
I'm trying to use dynamic finder on the server side which returns
nil. Guess I have to switch to find with conditions instead.