Enable raising on assignment to attr_readonly attributes

Rails 7.1 Framework Default

Enable raising on assignment to attr_readonly attributes. The previous behavior would allow assignment but silently not persist changes to the database.

Configuration

Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true

This is part of the Rails 7.1 framework defaults upgrade. See #10951 for the parent issue."

Edited by Vitaly Slobodin