m14t/csDoctrineActAsSortablePlugin — pull request #1 by m14t (2011-11-29 00:11:43+00:00)
Title: Duplicate Index check fails when modifying a `uniqueBy` column

Steps to reproduce:

1. Create a Sortable Class with at least one uniqueBy column (we'll use `cat_id` in this example).
2. Create 3 objects with a `cat_id` of 1. They should have positions 1, 2, and 3.
3. Create 1 objects with a `cat_id` of 2. It should have a position of 1.
4. Try and move the most recent object from `cat_id` 2 to `cat_id` 1.
5. Observe the `Doctrine_Connection_Sqlite_Exception` thrown.

This Pull Request simply adds a few extra test cases and a preUpdate listener that will move an object to the end of the list if it is changing categories.

Originally I wanted to do a `moveToPosition()` to whatever the previous position was, but doing this in a preUpdate can cause issues since it also does an update internally.