This breaks: 
  https://github.com/theforeman/foreman/blob/develop/test/lib/has_many_common_test.rb#L59

1. Given a host, my5name.mydomain.net
2. Set domain directly to "yourdomain.net" (as is done in has_many_common_test)
3. shortname_has_no_periods gets called on host.save! 
4. But "name" is STILL "my5name.mydomain.net" but domain is "yourdomain.net"
5. So the "shortname" is my5name.mydomain.net"
6. Validation fails

Any ideas here how to get name updated?