Sorry for the delay!

I think the way to solve this might be to add a before_validation method which is able to update the name when the domain changes, rather than overriding the setters (there are more than just domain_name=).

Rails provides old_* methods like old_domain, so you can compare old_domain to domain in the before_validation, then strip off the old domain.