Protect from empty attribute hashes
Call the `factory` function with the model as the context