I have a Message model with a content attribute (string) and a sent attribute (boolean). A message's content should be modifiable until it's been sent, after which that field should become read only. (Other attributes can still be modifiable, such as message_opened).
How can I accomplish this? I've looked into overriding readonly? (only applies at the record level), attr_readonly (not conditional), and validations (don't know how to make the validation of the content depend on both its old value and the sent field).