# File lib/state_machine/integrations/mongoid.rb, line 267
      def write(object, attribute, value, *args)
        result = super
        
        if (attribute == :state || attribute == :event && value) && !object.send("#{self.attribute}_changed?")
          current = read(object, :state)
          object.changes[self.attribute.to_s] = [attribute == :event ? current : value, current]
        end
        
        result
      end