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

Persisting Cargo needs improvement #45

Open
paulrayner opened this issue Jun 10, 2013 · 2 comments
Open

Persisting Cargo needs improvement #45

paulrayner opened this issue Jun 10, 2013 · 2 comments

Comments

@paulrayner
Copy link
Owner

Currently the store method in CargoRepository does a find first, then a delete if it finds a document. It does this because it had trouble detecting that a Cargo document already existing when doing an update after the Delivery object had been updated.

There should be a way to make this work without the find and delete step, and without having to store an extra Mongoid attribute in Cargo.

@drsharp
Copy link
Collaborator

drsharp commented Aug 28, 2014

Can't you do a Cargo create within a rescue block? It's not ideal but that would work and would save you the "find + delete + create" dance.

@paulrayner
Copy link
Owner Author

Sure. I'll try that. Thanks.

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

No branches or pull requests

2 participants