digitalplaywright/mongoid-slug — pull request #111 by ByScripts (2013-02-10 15:06:50+00:00)
Title: Fix localized slug creation when using history and when the locale changes after document is created

When using slug history, if the locale is changed after the document creation, and we try to save the document again, an error is raised :

# NoMethodError: undefined method `<<' for nil:NilClass
# from /path/to/lib/mongoid/slug.rb:123:in `build_slug'

This pull request fixes that by replacing `if !!self.history` by `if !!self.history && self._slugs.is_a?(Array)`