Adjust `Module.parent_name` to work when frozen; fixes #27637 ยท rails/rails@1d3ddac

Ruby on Rails. Contribute to rails/rails development by creating an account on GitHub.