-
Notifications
You must be signed in to change notification settings - Fork 5
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
Interoperability with Rails 6.0 insert_all
?
#9
Comments
Hi @nimmolo. I think that if you are using this gem in a basic way there is not major changes because both accept Array of Hashes as the first argument. They support different options in the second argument, for example If you are not using these options, switching between gems should be very simple. Even using the options, I think it shouldn't be that hard. What I recommend you is to create your own class/module and wrap mass_insert gem functionality and in the future when you upgrade rails you will just need to change that class/module. |
Hi Alejandro,
Thanks, that sounds good. If you like, I can submit a PR to add that to the docs... might be useful for others.
… On May 2, 2022, at 11:12 AM, Alejandro Gutiérrez ***@***.***> wrote:
Hi @nimmolo. I think that if you are using this gem in a basic way there is not major changes because both accept Array of Hashes as the first argument. They support different options in the second argument, for example insert_all supports the unique_by option and mass_insert supports primary_key, per_batch and handle_duplication options.
If you are not using these options, switching between gems should be very simple. Even using the options, I think it shouldn't be that hard. What I recommend you is to create your own class/module and wrap mass_insert gem functionality and in the future when you upgrade rails you will just need to change that class/module.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
@nimmolo I would appreciate a PR with that information. Thanks. |
Hi @alejandrodevs - thanks for this gem! I found it by looking for a backport of the Rails 6 bulk insert function
insert_all
.It seems like it uses the same syntax, is that correct? I ask because i'm wondering, if I use it in a Rails 5.2 project that one day gets updated to Rails 6, are there any changes i should think about?
The text was updated successfully, but these errors were encountered: