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

fix issue 38716 insert_all enum values by correctly type casting the … #38763

Merged
merged 1 commit into from
Mar 21, 2020

Conversation

yoelblum
Copy link

@yoelblum yoelblum commented Mar 18, 2020

fix issue 38716 insert_all enum values by correctly type casting the attributes

@simi
Copy link
Contributor

simi commented Mar 18, 2020

👍 I'll check locally some edge-cases and performance.

@ayufan
Copy link

ayufan commented Mar 19, 2020

Yay. Thank you :)

@rishav-csenitjsr
Copy link

Nice. Was doing the same thing.
Let’s say my class was Book which was having enum_value, But when I was printing Book.all after insert_all command, I was getting nil value for enum_value. Btw, thanks for sharing the PR

@rishav-csenitjsr
Copy link

@yoelblum specs are failing. Can you please look into it ?

…e attributes

fix insert_all enum test

fix rubocop, change  test to double quotes

Update activerecord/test/cases/insert_all_test.rb

fix inser_all_enum_values test: double quotes and order relation before pluck

Co-Authored-By: Ryuta Kamizono <kamipo@gmail.com>

change insert_all_enum_values test to not skip duplicates so it works across adapters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

insert_all does not work properly with enums as it does not cast types
6 participants