Merge branch 'master' into 2044-share-button refs #2044
[arvados.git] / services / api / app / models / log.rb
index e6969be87c98e2a527a450e4ac5f4d3681bbdc8f..6921eca9a4ab3e6db20c4b5ec9f6da603e602514 100644 (file)
@@ -1,5 +1,5 @@
 class Log < ArvadosModel
-  include AssignUuid
+  include HasUuid
   include KindAndEtag
   include CommonApiTemplate
   serialize :properties, Hash
@@ -24,7 +24,11 @@ class Log < ArvadosModel
 
   def fill_object(thing)
     self.object_uuid ||= thing.uuid
-    self.object_owner_uuid = thing.owner_uuid
+    if respond_to? :object_owner_uuid=
+      # Skip this if the object_owner_uuid migration hasn't happened
+      # yet, i.e., we're in the process of migrating an old database.
+      self.object_owner_uuid = thing.owner_uuid
+    end
     self.summary ||= "#{self.event_type} of #{thing.uuid}"
     self
   end