[ARVADOS] updated: 92ef95274c98a8ec0f4c76c9b30046f658f9ce35
git at public.curoverse.com
git at public.curoverse.com
Fri Aug 15 23:08:39 EDT 2014
Summary of changes:
services/api/app/models/arvados_model.rb | 15 +++++++++++++++
1 file changed, 15 insertions(+)
via 92ef95274c98a8ec0f4c76c9b30046f658f9ce35 (commit)
from 7d81fa519e768fd3bbafebef1530b1dfc5d845bc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 92ef95274c98a8ec0f4c76c9b30046f658f9ce35
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Aug 15 23:08:31 2014 -0400
3036: Restored normalize_collection_uuids removed in 22457e1
diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 52fe56d..c5a42ae 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -22,6 +22,7 @@ class ArvadosModel < ActiveRecord::Base
after_destroy :log_destroy
after_find :convert_serialized_symbols_to_strings
validate :ensure_serialized_attribute_type
+ validate :normalize_collection_uuids
validate :ensure_valid_uuids
# Note: This only returns permission links. It does not account for
@@ -373,6 +374,20 @@ class ArvadosModel < ActiveRecord::Base
[]
end
+ def normalize_collection_uuids
+ foreign_key_attributes.each do |attr|
+ attr_value = send attr
+ if attr_value.is_a? String and
+ attr_value.match /^[0-9a-f]{32,}(\+[@\w]+)*$/
+ begin
+ send "#{attr}=", Collection.normalize_uuid(attr_value)
+ rescue
+ # TODO: abort instead of silently accepting unnormalizable value?
+ end
+ end
+ end
+ end
+
@@prefixes_hash = nil
def self.uuid_prefixes
unless @@prefixes_hash
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list