+ def log_start_state
+ @old_etag = etag
+ @old_attributes = attributes
+ end
+
+ def make_log_around(event_type, old_thing, new_thing)
+ if self.is_a? Log
+ yield
+ else
+ log = Log.start_from(old_thing, event_type.to_s)
+ if not old_thing.nil?
+ log.properties['old_etag'] = @old_etag
+ log.properties['old_attributes'] = @old_attributes
+ end
+ yield
+ log.update_to new_thing
+ log_start_state
+ log.save
+ end
+ end