5737: Fix accidental use of local variable instead of intended instance method
[arvados.git] / services / api / app / models / job.rb
index 1c4742500f495a32dccdf22d3c8513dd5310058c..ef3d0b5e1028b41a2bab4d63aa300efb4743bc0a 100644 (file)
@@ -67,6 +67,10 @@ class Job < ArvadosModel
             (Complete = 'Complete'),
            ]
 
+  after_initialize do
+    @need_crunch_dispatch_trigger = false
+  end
+
   def assert_finished
     update_attributes(finished_at: finished_at || db_current_time,
                       success: success.nil? ? false : success,
@@ -336,7 +340,7 @@ class Job < ArvadosModel
         assign_uuid
         Commit.tag_in_internal_repository repository, script_version, uuid
       rescue
-        uuid = uuid_was
+        self.uuid = uuid_was
         raise
       end
     end