Failing tests for slug regeneration behaviour

Modify slug regeneration test so that record should not have to be saved
twice for its slug to be regenerated, and added failing tests for the
expected behaviour of #should_generate_new_friendly_id?
Simplify #should_generate_new_friendly_id? logic

The #should_generate_new_friendly_id? predicate, called as part of the
before_validation callback #set_slug, accesses the current_friendly_id
attribute. However this is only set in a before_save callback, meaning
it is only present if a held instance of a model has previously been
saved.

The predicate's comments indicated that it checked both this value and
the current slug column's value against a regenerated slug base, to see
if a new slug was needed. However it only checked one -
current_friendly_id if set, otherwise the current slug column value.

Fixing both of the above demonstrated that current_friendly_id was in
fact not needed, however, as when forced to be set before #set_slug was
called, it was always identical to the current slug column.

This commit removes current_friendly_id completely, and simplifies the
predicate's check to compare the slug base with only the existing slug
column value.

All tests pass except one in SimpleI18n, which appears to rely on the
earlier behaviour. This will be addressed in the next commit.
make :scoped and :history work together

do not complain when :scoped and :history are used together

keep track of the modules in use in Configuration.

This adds a uses? method which will return whether or not a given module is
used, e.g.

friendly_id_config.uses?(:scoped)

remove note about history module's incompatibility with the scope module

add back the index for the non-scoped case

handle scopes in the find_one and exists? overrides

when using :scoped friendly_ids aren't unique anymore, so we can't just use the
first match we find. Instead we now consider all ids in "with_old_friendly_id"
and use according conditions in "find_one" and "exists?" which will return the
proper object when used on the relation as adviced in the :scoped module
documentation, e.g.

@city.restaurants.find("joes-diner")
Updated changelog
Bumped version
Merge branch '4.0-stable'

Conflicts:
	Changelog.md
	test/history_test.rb
Use table_name_prefix instead of overriding Slug#name.
Merge pull request #334 from urbanautomaton/fix-slug-regeneration-behaviour

Fix slug regeneration behaviour
Added tests form some broken situations when using friendly_id and globalize
Fixed extract to account for other numbers in the slug
Changed syntax
update README with correct doc urls
Merge pull request #407 from stellard/4.0-stable

update README with correct doc urls
Added a unit test for modified code in SlugGenerator
Update README with 4.0-stable WhatsNew.md doc url

Use the 4.0-stable WhatsNew.md doc url in the Version 4.x section.
Merge pull request #428 from mpeteuil/use-4.0-stable-whatsnew-doc-url

Use 4.0 stable whatsnew doc url
Merge pull request #399 from acarr468/4.0-stable

Fixed "extract" in order to account for other numbers in the slug
Prepped 4.0.10 release
Added license to Gemspec
Update docs and AR version deps

Resolves #438
See #439