fixes #6881 -  check if in rake when validating template changes

unnecessary if you're only testing validation, removing it will speed up tests