before_validation :check_manifest_validity
before_validation :check_signatures
before_validation :strip_signatures_and_update_replication_confirmed
+ before_validation :name_null_if_empty
validate :ensure_pdh_matches_manifest_text
validate :ensure_storage_classes_desired_is_not_empty
validate :ensure_storage_classes_contain_non_empty_strings
around_update :manage_versioning, unless: :is_past_version?
api_accessible :user, extend: :common do |t|
- t.add :name
+ t.add lambda { |x| x.name || "" }, as: :name
t.add :description
t.add :properties
t.add :portable_data_hash
# correct timestamp in signed_manifest_text.
'manifest_text' => ['manifest_text', 'trash_at', 'is_trashed'],
'unsigned_manifest_text' => ['manifest_text'],
+ 'name' => ['name'],
)
end
end
end
+ def name_null_if_empty
+ if name == ""
+ self.name = nil
+ end
+ end
+
def set_file_names
if self.manifest_text_changed?
self.file_names = manifest_files
[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
joins("JOIN collections ON links.head_uuid = collections.uuid").
order("links.created_at DESC")
- docker_image_formats = Rails.configuration.Containers.SupportedDockerImageFormats
+ docker_image_formats = Rails.configuration.Containers.SupportedDockerImageFormats.keys.map(&:to_s)
if (docker_image_formats.include? 'v1' and
docker_image_formats.include? 'v2') or filter_compatible_format == false