app/models/file_asset.rb in hydra-head-3.0.1 vs app/models/file_asset.rb in hydra-head-3.1.0.pre1
- old
+ new
@@ -31,14 +31,18 @@
end
end
has_metadata :name => "descMetadata", :type => ActiveFedora::QualifiedDublinCoreDatastream do |m|
end
+
+ def label
+ descMetadata.title_values.first
+ end
def label=(label)
super
- datastreams_in_memory["descMetadata"].title_values = label
+ descMetadata.title_values = label
end
# augments add_file_datastream to also put file size (in bytes/KB/MB/GB/TB) in dc:extent
def add_file_datastream(file, opts={})
super
@@ -47,10 +51,10 @@
elsif file.kind_of?(File)
size = bits_to_human_readable(File.size(file))
else
size = ""
end
- datastreams_in_memory["descMetadata"].extent_values = size
+ datastreams["descMetadata"].extent_values = size
end
# Mimic the relationship accessor that would be created if a containers relationship existed
# Decided to create this method instead because it combines more than one relationship list
# from is_member_of_collection and part_of