Try opening once, instead of open/disconnect.
Split the database out to a separate object.
Move the slug unique check to the database object.
Refactor.
Write the first test for update.
Add scenarios.
Test value updates.
Verify that under normal circumstances, the slug is not changed.
Verify that the slug can be changed.
Add a failing test for changing a slug to a non-unique value.
If the slug is changed to a non-unique value, append the timestamp to it.
Test slug conflicts on update and invalid slugs.
Break out the database calls.
Extract the lookup by slug.
Extract the database update.
Refactor.
Extract the first bit of repeated slugify logic.
Find should return one item, not an array.
Replace another database lookup.
This does not belong in the database.