X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/64f0317055404631dbbff6f21a917e0e3e34999b..9906b9c66c4052362d38fd99f838cef0c3a7edcb:/app/models/orvos_base.rb?ds=sidebyside diff --git a/app/models/orvos_base.rb b/app/models/orvos_base.rb index 7262df061d..96016059ca 100644 --- a/app/models/orvos_base.rb +++ b/app/models/orvos_base.rb @@ -23,11 +23,17 @@ class OrvosBase < ActiveRecord::Base ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) end def self.find(uuid) + if uuid.class != String or uuid.length < 27 then + raise 'argument to find() must be a uuid string. Acceptable formats: warehouse locator or string with format xxxxx-xxxxx-xxxxxxxxxxxxxxx' + end new.private_reload(uuid) end def self.where(*args) OrvosResourceList.new(self).where(*args) end + def self.limit(*args) + OrvosResourceList.new(self).limit(*args) + end def self.eager(*args) OrvosResourceList.new(self).eager(*args) end @@ -102,7 +108,7 @@ class OrvosBase < ActiveRecord::Base if uuid_or_hash.is_a? Hash hash = uuid_or_hash else - hash = $orvos_api_client.api(self.class, '/' + uuid_or_hash.to_s) + hash = $orvos_api_client.api(self.class, '/' + uuid_or_hash) end hash.each do |k,v| if self.respond_to?(k.to_s + '=')