Fix spec issues related to Mongoid::Paranoia not loading properly
require activesupport dependencies to fix error in test on ruby 1.9.3 and mongoid4
give credit for changes
This commit extracts index options to it's own class, to clean up the code a bit and make easier to test. It does not change the API of the gem.
Fix compatibility between Mongoid::Paranoia and Mongoid::Slug

Currently, when Mongoid Paranoia deletes a document, it's `_slugs` field value remains in the DB. This can cause the unique index to throw an error when saving a new record with the same slug.

In order to fix this, we must unset the `_slugs` field when a paranoid doc is destroyed, and reset the slug when it is restored.

Includes the following changes:

- Add support for callbacks around the `restore` method, if not natively supported by the Mongoid::Paranoia implementation (simi/mongoid-paranoia supports it, mongoid-paranoia gem and Mongoid 3 do not.)

- Revert test mongoid-paranoia repo to 'simi/mongoid-paranoia'. Seems currently there are two competing mongoid-paranoia repos (see here: https://github.com/haihappen/mongoid-paranoia/issues/1)

- Rename `set_slug` method to `apply_slug`. The are new `set_slug` and `unset_slug` methods which literally call Mongoid `set` and `unset`.
- Fix paranoid spec issue for Mongoid 4
- Add paranoid specs for both permanent and non-permanent slug cases
- Add better handling of edge case of re-saving destroyed paranoid documents
- Rename set_slug, unset_slug etc to set_slug!, etc. (add ! to method name)
- Update CHANGELOG.md and README.md
Merge pull request #165 from johnnyshields/paranoia-v2

Fix compatibility between Mongoid::Paranoia and Mongoid::Slug
Merge branch 'master' of github.com:digitalplaywright/mongoid-slug

Conflicts:
	lib/mongoid_slug.rb
Make find unique slug thread safe
Merge pull request #168 from jaxesn/master

Make find unique slug thread safe
Update CHANGELOG.md
Better handling of unique and sparse index constraints:
- :sparse is always set (no harm in setting it, in theory speeds up some edge cases where _slugs is unset on a large number of records)
- :unique is always set EXCEPT for an edge case related to paranoid docs. Previously we were not setting unique when by_model_type was true, however, I cannot think of a good reason not to set it in this case.
Merge branch 'index-unique-sparse'