before_validation :check_signatures
before_validation :strip_signatures_and_update_replication_confirmed
before_validation :name_null_if_empty
+ validate :ensure_filesystem_compatible_name
validate :ensure_pdh_matches_manifest_text
validate :ensure_storage_classes_desired_is_not_empty
validate :ensure_storage_classes_contain_non_empty_strings
should_preserve_version = should_preserve_version? # Time sensitive, cache value
return(yield) unless (should_preserve_version || syncable_updates.any?)
- # Put aside the changes because with_lock forces a record reload
+ # Put aside the changes because with_lock requires an explicit record reload
changes = self.changes
snapshot = nil
- with_lock do
+ reload.with_lock do
# Copy the original state to save it as old version
if should_preserve_version
snapshot = self.dup
[c.portable_data_hash, c]
}]
- puts "mg #{migrated_collections} #{collections}"
-
collections.map { |c|
# Check if the listed image is compatible first, if not, then try the
# migration link.
manifest = Keep::Manifest.new(c.manifest_text)
- puts "m1 #{manifest.exact_file_count?(1)} #{manifest.files[0][1]} #{pattern}"
if manifest.exact_file_count?(1) and manifest.files[0][1] =~ pattern
c
elsif m = migrated_collections[migrations[c.portable_data_hash]]
- puts "m2 #{manifest.exact_file_count?(1)} #{manifest.files[0][1]} #{pattern}"
manifest = Keep::Manifest.new(m.manifest_text)
if manifest.exact_file_count?(1) and manifest.files[0][1] =~ pattern
m
return
end
(managed_props.keys - self.properties.keys).each do |key|
- if managed_props[key].has_key?('Value')
- self.properties[key] = managed_props[key]['Value']
- elsif managed_props[key]['Function'].andand == 'original_owner'
+ if managed_props[key]['Function'] == 'original_owner'
self.properties[key] = self.user_owner_uuid
+ elsif managed_props[key]['Value']
+ self.properties[key] = managed_props[key]['Value']
else
logger.warn "Unidentified default property definition '#{key}': #{managed_props[key].inspect}"
end