You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print the params before sending the request in the test file, and print the received params in the controller, you will notice that the nested attributes are mixed and well formed.
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 6-1-stable branch or on main, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 6-1-stable branch or on main, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
Steps to reproduce
I have created an example project to reproduce the error with
rspec
andminitest
:https://github.com/yalmasri/rspec-nested
add validation
with_options
to validate attributes by enum type:https://github.com/yalmasri/rspec-nested/blob/master/app/models/seek.rb#L4
create test and send 2 nested records to be created, each record with a different enum type and different attributes:
print the params before sending the request in the test file, and print the received params in the controller, you will notice that the nested attributes are mixed and well formed.
also you can refer to rspec issue I have created: rspec is mixing nested attributes rspec/rspec-rails#2459
Expected behavior
expected to receive the nested attributes as it has been declared in the test file
Actual behavior
if you send 2 nested attributes, controller receive the params mixed one with the other.
System configuration
Rails version:
Rails 6.1.2.1
Ruby version:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
The text was updated successfully, but these errors were encountered: