Ok, let's rename that method :)
Currently the existence of a key is used to determine, if a model is persisted or not. We can of course change this and
introduce a new instance variable to save if this model is persisted or not. This would default to false (for models created
by the user) and be set to true by the Collection when it came from the database. I think that keeps the separation between
the concerns of the Collection and Model.
But would that be useful in your case? Because if I understood you correctly, you would like to create a Model on your own
(which would – in the implementation as described above – mean that `persisted?` returns false. So the `save` method would
ask the model, if it is persisted, it would say "No, I'm not persisted" and therefore call the `create` method.
And this is not what you would want it to do, right?
Another way to do this would be to always just find or create by the key. But with this way you could overwrite entries in the database
by accident, because you choose a key that has been chosen before.
Is there a different way?
Best Wishes,
Lucas