This project is archived and is in readonly mode.
validates_associated throws 'can't modify frozen object' error
-
Bob Lail
I dug into this a little more and wrote a blog post about the problem: Using validates_associated with composed_of and ActiveModel::Validations.
In a nutshell:
- ActiveRecord::Aggregations (deliberately) freezes objects assigned to a composed attribute
- But ActiveModel::Validations tries to create two ivars:
@errorsand@validation_contexton the frozen object