Behave nicer if supplied owner_uuid is not a valid uuid at all.
authorTom Clegg <tom@curoverse.com>
Mon, 5 May 2014 10:08:30 +0000 (06:08 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 5 May 2014 10:08:30 +0000 (06:08 -0400)
services/api/app/models/arvados_model.rb

index ae0e490c6e08c0d2d46ba463181ced01b758a994..e495f9ff75f978439b909d824079e0114278402b 100644 (file)
@@ -144,6 +144,8 @@ class ArvadosModel < ActiveRecord::Base
           if x == uuid
             # Test for cycles with the new version, not the DB contents
             x = owner_uuid
+          elsif !owner_class.respond_to? :find_by_uuid
+            raise ActiveRecord::RecordNotFound.new
           else
             x = owner_class.find_by_uuid(x).owner_uuid
           end