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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Error for Array-Based Composite Keys in nested_attribute #613

Merged
merged 3 commits into from
Dec 4, 2023

Conversation

yebityon
Copy link
Contributor

@yebityon yebityon commented Dec 2, 2023

Problem Description

I recently updated my project to Rails 6 and faced a testing error when passing a composite key as an array to nested_attribute.

I have added a test case for this error. Please refer to this test case if necessary.

PR Description

Since this commit, record detection in nested_attributes.rb has been conducted using the detect method instead of cpk_detect_record.

I could not find any mention of this change, and considering that cpk_detect_record still exists in nested_attributes.rb but is not used, I created this PR.

This PR reverts to the approach used prior to the introduction of this PR.

If we are intended to use CompositePrimaryKeys::CompositeKeys for creating id as demonstrated in the test case (i.e., if the above change was intentional), I will close this PR.

Also, a quick thanks to the maintainers for their ongoing work on the project 馃憤

@cfis
Copy link
Contributor

cfis commented Dec 4, 2023

Looks good to me - thanks!

@cfis cfis merged commit 375e327 into composite-primary-keys:master Dec 4, 2023
20 checks passed
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.

None yet

2 participants