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

michaelmior commented May 16, 2013

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

@philfreo
Copy link
Collaborator

philfreo commented May 13, 2013

+1

@PaulUithol
Copy link
Owner

PaulUithol commented May 16, 2013

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 michaelmior:model-find branch Jun 19, 2013
@michaelmior
Copy link
Contributor Author

michaelmior commented Jun 19, 2013

Thanks for the merge :)

@wulftone
Copy link

wulftone commented Jul 25, 2013

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

michaelmior commented Jul 25, 2013

@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.