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

.find() shortcut #345

Merged
merged 1 commit into from
Jun 19, 2013
Merged

.find() shortcut #345

merged 1 commit into from
Jun 19, 2013

Conversation

michaelmior
Copy link
Contributor

Thoughts on adding a .find(attrs, options) shortcut which would be equivalent to .findOrCreate(attrs, _.defaults({create: false}, options))?

@philfreo
Copy link
Collaborator

+1

@PaulUithol
Copy link
Owner

Yeah, that sounds pretty good actually. I do hope not too many people will mix it up with instance.find, which proxies to underscore's find.

PaulUithol added a commit that referenced this pull request Jun 19, 2013
@PaulUithol PaulUithol merged commit 8d2b3f0 into PaulUithol:master Jun 19, 2013
@michaelmior michaelmior deleted the model-find branch June 19, 2013 12:31
@michaelmior
Copy link
Contributor Author

Thanks for the merge :)

@wulftone
Copy link

This is awesome, but I think it's a little backwards... find depending on findOrCreate? Shouldn't it be the other way around? : )

@michaelmior
Copy link
Contributor Author

@wulftone You're probably right. I was simply didn't touch findOrCreate to avoid potentially breaking existing code. There's no duplication in the implementation of each though, so I don't think it's a big concern.

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

Successfully merging this pull request may close these issues.

4 participants