Adds $isDirty() method to resource