vrana/notorm — pull request #71 by zacharyrankin (2013-08-26 23:58:05+00:00)
Title: Add another method to do insert/update on duplicate called admit()

I have 2 reasons behind this change, and maybe there is another way, but I couldn't find a better solution.

1. insert_update() within a transaction in postgres doesn't work. Reason is that postgresql will automatically kill the transaction as soon as there is an error, even if there is code to catch it :(

2. I was constantly fetching the row that was updated() after calling insert_update() because update() doesn't return the row after it was updated.

An example is adding a unique tag, that you then want to add to an affiliation table:

```
$tag = $this->db->tags()->admit(array('tag' => $cleaned_tag));
$this->db->packages_tags()->admit(array(
'package_id' => $this->package['id'],
'tag_id' => $tag['id']
));
```

Let me know what you think ... NotORM is so amazing, thank you