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

add insert_or_update/2 and insert_or_update!/2 #141

Merged
merged 1 commit into from May 30, 2021
Merged

add insert_or_update/2 and insert_or_update!/2 #141

merged 1 commit into from May 30, 2021

Conversation

cschmatzler
Copy link
Contributor

finally fixes #23 after years

@izelnakri
Copy link
Owner

Thank you for your contribution @cschmatzler ! I'll review this PR within this 7 days.

when model: struct
def insert_or_update(
changeset,
options \\ [origin: nil, meta: nil, originator: nil, prefix: nil]
Copy link
Owner

@izelnakri izelnakri May 28, 2021

Choose a reason for hiding this comment

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

Could you also add the following to the default options list:

          model_key: :model,
          version_key: :version,
          ecto_options: [],
          initial_version_key: :initial_version,

@izelnakri
Copy link
Owner

Nice job, thank you for this feature! I'll pull and test it locally this week, meanwhile would appreciate if you apply my suggested default options to the methods. Talk to you soon :)

@izelnakri izelnakri merged commit aa9fea2 into izelnakri:main May 30, 2021
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.

Ecto.Repo.insert_or_update and Ecto.Repo.insert_or_update!
2 participants