Skip to content

Conversation

@andrewclink
Copy link

This PR adds exclude: to upsert_options to allow one to leave certain attributes alone during an upsert. The use case is when a column is defined as NOT NULL DEFAULT "something" and an attempt to insert NULL into that column is unwanted.

This includes minimal passing tests.

Ruby 2.3+ is required due to the safe navigation operator being used once. If that's undesirable, an explicit check for nil could be used instead.

@andrewclink
Copy link
Author

This fixes #102

@olleolleolle
Copy link
Collaborator

Regarding the 2.3, the CI only tests 2.4+. We should be good there.

@jesjos
Copy link
Owner

jesjos commented Nov 19, 2022

@andrewclink Can you rebase your branch on the target branch?

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.

3 participants