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

Reset polymorphic id upon type change #3630

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

KMinChrist
Copy link
Contributor

Hi, thank you for your attention. Currently, for polymorphic association fields, the id persists after type is changed, which may be unclear to users and cause a bug if the id is selected before type. With this change, the id field can be reset each time the type field changes. I hope you can approve this merge request. Thank you!

@mshibuya
Copy link
Member

Thank you for the PR. The fix makes sense, could you add a test case to verify this?
https://github.com/railsadminteam/rails_admin/blob/master/spec/integration/fields/polymorphic_assosiation_spec.rb will be the best place to work.

@mshibuya mshibuya merged commit b666c63 into railsadminteam:master Aug 25, 2024
@mshibuya
Copy link
Member

Let me write a test. Thank you.

mshibuya added a commit that referenced this pull request Aug 25, 2024
- Add a spec
- Apply Prettier
mshibuya added a commit that referenced this pull request Sep 1, 2024
mshibuya added a commit that referenced this pull request Sep 1, 2024
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.

2 participants