Added fix for after_commit for use with mongoid.