-
Notifications
You must be signed in to change notification settings - Fork 21.9k
Closed
Labels
Description
Steps to reproduce
- A Customer model has
accepts_nested_attributes_for :phones
andhas_many :phones
. - The Phone model has
belongs_to :customer
When creating a customer with phone attributes, the validations prevent the number (and customer) from being created.
Please see both of these repos:
Rails 4.2.6 works without an issue.
If I disable validations in the controller when saving the customer (by changing @customer.save
to @customer.save(validate: false)
), both models save and work as expected
Expected behavior
The customer should be saved. The phone should also be saved linked to the customer
Actual behavior
The customer and phone fails to save and throws a validation error
System configuration
Rails version: 5.0.0.rc1
Ruby version: 2.3.1
joallard, jch-wtag, lHydra, jerryjohnjacob, tradeli and 10 more