Class: DigitalRecordChildren

Inherits:
JSONModel
  • Object
show all
Includes:
RecordChildren
Defined in:
frontend/app/models/digital_record_children.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from RecordChildren

#child_type, included

Instance Attribute Details

#uriObject

Returns the value of attribute uri



7
8
9
# File 'frontend/app/models/digital_record_children.rb', line 7

def uri
  @uri
end

Class Method Details

.clean(child) ⇒ Object



13
14
15
16
# File 'frontend/app/models/digital_record_children.rb', line 13

def self.clean(child)
  super
  clean_file_versions(child)
end

.clean_file_versions(child) ⇒ Object



18
19
20
21
22
23
24
# File 'frontend/app/models/digital_record_children.rb', line 18

def self.clean_file_versions(child)
  return unless child["file_versions"]

  if child["file_versions"][0].reject {|k, v| (k == "publish" && v == true) || v.blank?}.empty?
    child.delete("file_versions")
  end
end

.uri_for(*args) ⇒ Object



9
10
11
# File 'frontend/app/models/digital_record_children.rb', line 9

def self.uri_for(*args)
  nil
end