Please sign in to comment.
Raise error when using write_attribute with a non-existent attribute.
Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing.
- Loading branch information...
Showing with 47 additions and 25 deletions.
- +7 −3 activerecord/lib/active_record/attribute_methods/write.rb
- +4 −1 activerecord/lib/active_record/autosave_association.rb
- +1 −1 activerecord/lib/active_record/persistence.rb
- +3 −1 activerecord/lib/active_record/timestamp.rb
- +11 −6 activerecord/test/cases/persistence_test.rb
- +7 −6 activerecord/test/cases/serialization_test.rb
- +7 −6 activerecord/test/models/contact.rb
- +7 −1 activerecord/test/schema/schema.rb