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

Allow existing models in eager/flat create #199

Merged
merged 44 commits into from
Nov 3, 2018

Conversation

mclark4386
Copy link
Member

@mclark4386 mclark4386 commented Aug 10, 2018

Allows use of existing objects which will update them instead of duplicating them.

WARNING: this will overwrite an object to be empty for fields that are missing currently. Would love input as to how people would like to handle this... if exists just create association? only update if valid? leave it to the user of the library with a strong warning? (In my mind this is the only reason it's WIP and not done)

@mclark4386 mclark4386 changed the base branch from master to development August 10, 2018 10:26
@mclark4386 mclark4386 requested a review from a team August 10, 2018 10:31
@mclark4386
Copy link
Member Author

mclark4386 commented Aug 10, 2018

travis is aggravating...

@mclark4386 mclark4386 changed the title WIP: Allow existing models in eager create [WIP] Allow existing models in eager create Aug 27, 2018
@mclark4386
Copy link
Member Author

Going a different way with this now. (Just to document this in public and give an update.)
Flat creates will now create associations with existing objects, but only the associations and will ignore new nested object (object that don't have an ID assigned and exist in the DB).
Eager creates will created everything as it does now, but if the nested object already exists it'll only create the association and not otherwise change the existing object.

@mclark4386 mclark4386 force-pushed the allow_existing_models_in_eager_create branch from 9217659 to b80faa0 Compare September 29, 2018 08:18
@mclark4386 mclark4386 changed the title [WIP] Allow existing models in eager create Allow existing models in eager create Oct 1, 2018
@mclark4386
Copy link
Member Author

Think it's good to go now!

README.md Outdated Show resolved Hide resolved
@mclark4386 mclark4386 changed the title Allow existing models in eager create Allow existing models in eager/flat create Oct 4, 2018
@mclark4386 mclark4386 requested review from a team October 11, 2018 06:22
larrymjordan and others added 4 commits October 12, 2018 20:02
* [Fix] issue when using IN more than once '?' wildcards

* slices with in
* The lastest docs are on the website, and keeping them here mislead users.
* Let's use SHOULDERS here too!
…#271)

* improved cockroach configuration and fixed bugs on connection details

* oops! didn't remove debugging log

* bugfix: blank argument also affect as argument, in secure mode
@stanislas-m stanislas-m self-assigned this Oct 18, 2018
Copy link
Member

@stanislas-m stanislas-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, here are some points to fix first. :)

associations/has_many_association.go Outdated Show resolved Hide resolved
associations/has_many_association.go Outdated Show resolved Hide resolved
associations/has_many_association.go Outdated Show resolved Hide resolved
associations/has_one_association.go Outdated Show resolved Hide resolved
associations/has_one_association.go Outdated Show resolved Hide resolved
associations/has_one_association.go Outdated Show resolved Hide resolved
associations/has_one_association.go Outdated Show resolved Hide resolved
@mclark4386 mclark4386 force-pushed the allow_existing_models_in_eager_create branch from c3a3175 to f2e5783 Compare October 21, 2018 03:02
@mclark4386
Copy link
Member Author

... and now I'm going to fix this rebase mess...

stanislas-m and others added 6 commits October 26, 2018 12:05
* [Fix] issue when using IN more than once '?' wildcards

* slices with in
* The lastest docs are on the website, and keeping them here mislead users.
* Let's use SHOULDERS here too!
…#271)

* improved cockroach configuration and fixed bugs on connection details

* oops! didn't remove debugging log

* bugfix: blank argument also affect as argument, in secure mode
* Deprecate Left and Right InnerJoins in favor of one InnerJoin.

* Add oncer Deprecation notices to LeftInnerJoin and RightInnerJoin
executors.go Outdated Show resolved Hide resolved
executors.go Outdated Show resolved Hide resolved
associations/has_many_association.go Outdated Show resolved Hide resolved
dialect_cockroach.go Outdated Show resolved Hide resolved
associations/has_one_association.go Show resolved Hide resolved
associations/association.go Outdated Show resolved Hide resolved
associations/has_many_association.go Outdated Show resolved Hide resolved
associations/has_one_association.go Outdated Show resolved Hide resolved
associations/has_one_association.go Outdated Show resolved Hide resolved
executors.go Outdated Show resolved Hide resolved
@stanislas-m stanislas-m merged commit beaaf34 into development Nov 3, 2018
@stanislas-m stanislas-m deleted the allow_existing_models_in_eager_create branch November 3, 2018 13:28
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.

5 participants