Skip to content

Instantly share code, notes, and snippets.

@phuongdh
Last active December 14, 2015 00:29
Show Gist options
  • Save phuongdh/4999083 to your computer and use it in GitHub Desktop.
Save phuongdh/4999083 to your computer and use it in GitHub Desktop.
Screwy SimpleDatastream
[56] pry(main)> mo = MediaObject.find("hydrant:175")
=> #<MediaObject:3344532618636883548 @pid="hydrant:175" >
[57] pry(main)> mo.section_pid
=> ["hydrant:176"]
[58] pry(main)> mo.section_pid = []
=> []
[59] pry(main)> mo.section_pid
=> ["hydrant:176"]
[60] pry(main)> mo.section_pid = []
=> []
[61] pry(main)> mo.save
=> true
[62] pry(main)> mo.section_pid
=> ["hydrant:176"]
[63] pry(main)> mo.section_pid = [""]
=> [""]
[64] pry(main)> mo.section_pid
=> []
has_metadata name:'sectionsMetadata', :type => ActiveFedora::SimpleDatastream do |sds|
sds.field :section_pid, :string
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment