move attr_encrypted to the resource and add to generator