-
Notifications
You must be signed in to change notification settings - Fork 32
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
fix: Use more permissive argument passthrough for insert_all and upsert_all #275
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
I also have no personal objections or license claims that prevent a duplicate PR with the same effective changes. Particularly if there's a better / more idiomatic way you'd like to implement this. |
Yes, probably. It seems that GitHub only knows your gmail + Recurly email: https://github.com/googleapis/ruby-spanner-activerecord/pull/275/checks?check_run_id=18724134666 If you signed the CLA using an I don't have a better way to implement this, I just wanted to make sure that you don't feel like I'm stealing your credits here. |
Closing this as #283 has been merged and released. Thanks for your contribution! |
fixes #274
Rails 7.0 introduced new keyword arguments to
ActiveRecord::Base.upsert_all
andActiveRecord::Base.insert_all
. The same methods without_all
call through to the_all
versions of the methods, passing along the new keyword arguments.For example, in Rails 7.0.8 activerecord/lib/active_record/persistence.rb we see:
When this library's override of
upsert_all
is called with theon_duplicate:
andrecord_timestamps:
keyword arguments, an error is raised:We can see this in the test suite by adding a test to
acceptance/cases/models/insert_all_test.rb
like:and setting
AR_VERSION=7.0.8
in the environment before running the acceptance suite.Changes
This PR changes the method signatures for
insert_all!
andupsert_all
to use keyword splats (**kwargs
) instead of specific, individual keywords.