Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconstency with +find+ #51

Closed
nfo opened this issue Aug 23, 2010 · 4 comments
Closed

Inconstency with +find+ #51

nfo opened this issue Aug 23, 2010 · 4 comments
Labels

Comments

@nfo
Copy link

nfo commented Aug 23, 2010

> MyDocument.find(nil)
[
   [0] <MyDocument: created_at=2010-08-18 20:13:31 +0200 updated_at=nil body=nil>
]
> MyDocument.find("")
<MyDocument: created_at=2010-08-18 20:13:33 +0200 updated_at=nil body=nil>
> MyDocument.find
nil
@nfo
Copy link
Author

nfo commented Aug 23, 2010

I would expect nothing more than nil in all cases.

@seancribbs
Copy link
Contributor

Yes, or an ArgumentError.

@nfo
Copy link
Author

nfo commented Aug 23, 2010

ArgumentError if no arguments are given. Otherwise, only find! should return an exception ?

@seancribbs
Copy link
Contributor

I think it's reasonable that a bad key (nil or ""), or an empty argument list should raise an ArgumentError. The question is, in what situations should we silently ignore them, if at all?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants