I know I wrote this, but should we perhaps extract this kind of logic out into a valid_path_attributes()  method or something? We seem to repeat it a lot.