X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c0650d1d845b08668445fa5245d0e532b38afb95..7e54f217895d2f401563c54704c73a196e2d236d:/services/api/app/models/arvados_model.rb?ds=sidebyside diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb index 51673f7acb..672374bc6c 100644 --- a/services/api/app/models/arvados_model.rb +++ b/services/api/app/models/arvados_model.rb @@ -271,6 +271,18 @@ class ArvadosModel < ActiveRecord::Base protected + def self.deep_sort_hash(x) + if x.is_a? Hash + x.sort.collect do |k, v| + [k, deep_sort_hash(v)] + end.to_h + elsif x.is_a? Array + x.collect { |v| deep_sort_hash(v) } + else + x + end + end + def ensure_ownership_path_leads_to_user if new_record? or owner_uuid_changed? uuid_in_path = {owner_uuid => true, uuid => true} @@ -518,7 +530,7 @@ class ArvadosModel < ActiveRecord::Base end def self.uuid_like_pattern - "_____-#{uuid_prefix}-_______________" + "#{Rails.configuration.uuid_prefix}-#{uuid_prefix}-_______________" end def self.uuid_regex