Fixing regenerate rake task to not use private method.