Sample Rails project for issue rails/rails#9746
Installation
Install the gems:
bundle install
Rake db setup task:
rake db:create
rake db:migrate
Steps to reproduce:
1. Go to new document form by clicking "New Document" link.
2. Input the form fields(fields are mandatory to test) and submit(after submit the form, it render with validation error message for user_id in paragraph model and now the form has primary id)
3. Click on submit(goes to update action)
-
The problem only occur when we passing parameters with content_ids.
-
Validation is running when we assinging parameter using attributes=.( But the document says validation doesn't trigger while assigning attributes to the object using attributes=)
for example:
params = {"document"=>{"name"=>"sadfds", "sections_attributes"=>{"0"=>{"name"=>"", "content_ids"=>["1", "2"]}}}}
@document = Document.new
@document.attributes = params #validation is running in this line