Adapt to new behaviour for `after_update` callback
Adapt to new behaviour for `after_update` callback

Mongoid 8 introduced new behaviour for `after_*` callbacks which makes it consistent with Rails' ActiveRecord Dirty tracking behaviour. This was documented in the gem [release notes][].

We can no longer use `slug_changed?` in the `after_update` callback to determine if an Artefact's slug was changed. However we can still access it from the `before_update` callback because the change hasn't yet been persisted at that point.

The workaround is to remember the value of `slug_changed?` in an instance variable that we can then use from the `after_update` callback.

[release notes]: https://www.mongodb.com/docs/mongoid/master/release-notes/mongoid-8.0/#changeable-module-behavior-made-compatible-with-activemodel-dirty

alphagov/publisher,alphagov/publisher,alphagov/publisher