11789: Merge branch 'master' into 11789-arvput-exclude-flag
[arvados.git] / services / api / db / migrate / 20140319160547_separate_repository_from_script_version.rb
index e7409879fbd7084cc197135e95928d1af28da7da..fc09892ec8d472020e1e0477e91bfd15c7a2f41b 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class SeparateRepositoryFromScriptVersion < ActiveRecord::Migration
   include CurrentApiClient
 
@@ -5,7 +9,7 @@ class SeparateRepositoryFromScriptVersion < ActiveRecord::Migration
     c = pt.components
     c.each do |k, v|
       commit_ish = v["script_version"]
-      if commit_ish.index(':')
+      if commit_ish.andand.index(':')
         want_repo, commit_ish = commit_ish.split(':',2)
         v[:repository] = want_repo
         v[:script_version] = commit_ish