Skip to content

Instantly share code, notes, and snippets.

@awead
Created January 16, 2015 16:20
Show Gist options
  • Save awead/c318aa5d8629bdb4cbca to your computer and use it in GitHub Desktop.
Save awead/c318aa5d8629bdb4cbca to your computer and use it in GitHub Desktop.
Writing to fcr:metadata
irb(main):018:0> f4.thumbnail.metadata.get_values(ActiveFedora::RDF::Fcrepo4.created)
=> [Fri, 16 Jan 2015 03:43:25 +0000]
irb(main):019:0> f4.thumbnail.metadata.set_value(ActiveFedora::RDF::Fcrepo4.created, "foo")
=> nil
irb(main):020:0> f4.thumbnail.metadata.get_values(ActiveFedora::RDF::Fcrepo4.created)
=> ["foo"]
irb(main):021:0> f4.thumbnail.metadata.save
NoMethodError: undefined method `local_attributes' for #<ActiveFedora::WithMetadata::MetadataNode:0x007fc8c9e8d340>
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/rdf-1.1.7/lib/rdf/mixin/enumerable.rb:693:in `method_missing'
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/rdf-1.1.7/lib/rdf/mixin/mutable.rb:175:in `method_missing'
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/activemodel-4.1.7/lib/active_model/attribute_methods.rb:435:in `method_missing'
from /Users/awead/Projects/Github/projecthydra/active_fedora/lib/active_fedora/change_set.rb:30:in `block in changes'
from /Users/awead/Projects/Github/projecthydra/active_fedora/lib/active_fedora/change_set.rb:21:in `each'
from /Users/awead/Projects/Github/projecthydra/active_fedora/lib/active_fedora/change_set.rb:21:in `each_with_object'
from /Users/awead/Projects/Github/projecthydra/active_fedora/lib/active_fedora/change_set.rb:21:in `changes'
from /Users/awead/Projects/Github/projecthydra/active_fedora/lib/active_fedora/with_metadata/metadata_node.rb:41:in `save'
from (irb):21
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/commands/console.rb:90:in `start'
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/commands/console.rb:9:in `start'
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:69:in `console'
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/awead/Projects/Github/psu-stewardship/scholarsphere/.bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):022:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment