Created
May 2, 2013 14:46
-
-
Save jcoyne/5502707 to your computer and use it in GitHub Desktop.
Esme's problem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class XVocabulary < ActiveFedora::Base | |
has_many :x_vocabulary_entries, :property => :vocabularyEntry, :inverse_of => :x_vocabulary | |
end | |
=> #<Proc:0x007fbd056b4b20@/Users/justin/workspace/active_fedora/lib/active_fedora/associations.rb:265 (lambda)> | |
class XVocabularyEntry < ActiveFedora::Base | |
belongs_to :x_vocabulary, :property => 'dams:vocabulary', :inverse_of => :vocabulary | |
end | |
=> #<Proc:0x007fbd056d7dc8@/Users/justin/workspace/active_fedora/lib/active_fedora/associations.rb:275 (lambda)> | |
XVocabulary.create | |
=> #<XVocabulary pid:"changeme:4747", > | |
XVocabulary.create | |
=> #<XVocabulary pid:"changeme:4748", > | |
ve = XVocabularyEntry.create(x_vocabulary_id: "changeme:4747") | |
=> #<XVocabularyEntry pid:"changeme:4750", > | |
ve.x_vocabulary_id | |
=> "changeme:4747" | |
ve.x_vocabulary_id = "changeme:4748" | |
=> "changeme:4748" | |
ve.save! | |
=> true | |
>> ve.reload | |
=> #<XVocabularyEntry pid:"changeme:4750", > | |
ve.x_vocabulary_id | |
=> "changeme:4748" | |
ve.RELS_EXT.content | |
=> "\n<rdf:RDF xmlns:ns0=\"info:fedora/fedora-system:def/model#\" xmlns:ns1=\"info:fedora/fedora-system:def/relations-external#dams:\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <rdf:Description rdf:about=\"info:fedora/changeme:4750\">\n <ns0:hasModel rdf:resource=\"info:fedora/afmodel:XVocabularyEntry\"></ns0:hasModel>\n <ns1:vocabulary rdf:resource=\"info:fedora/changeme:4748\"></ns1:vocabulary>\n </rdf:Description>\n</rdf:RDF>\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment