X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/62121f9b2f15cd35a6ce5b6e66ccaaae1c1af834..5debe2b77df18d381d7d59976e76f4ea6c9d5ce0:/services/api/app/models/arvados_model.rb diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb index 51673f7acb..18d5647cc9 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 @@ -624,7 +636,7 @@ class ArvadosModel < ActiveRecord::Base end def log_destroy - log_change('destroy') do |log| + log_change('delete') do |log| log.fill_properties('old', etag(@old_attributes), @old_logged_attributes) log.update_to nil end