Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added :path option to ActiveFedora::QualifiedDublinCoreDatastream#field ... #135

Merged
merged 1 commit into from
Jul 3, 2013
Merged

Added :path option to ActiveFedora::QualifiedDublinCoreDatastream#field ... #135

merged 1 commit into from
Jul 3, 2013

Conversation

dchandekstark
Copy link
Member

...in order to support, for example,

mapping the term :dc_type to dcterms:type (:type is excluded from ActiveFedora::QualifiedDublinCoreDatastream::DCTERMS).
Implementation simply adds :path (even if nil) to OM::XML::Term.new since initializer falls back to field name anyway.

…ld in order to support, for example,

mapping the term :dc_type to <dcterms:type> (:type is excluded from ActiveFedora::QualifiedDublinCoreDatastream::DCTERMS).
Implementation simply adds :path (even if nil) to OM::XML::Term.new since initializer falls back to field name anyway.
@dchandekstark
Copy link
Member Author

With this patch I can add the :dc_type term to descMetadata, to point to dcterms:type, by doing this in my AF model:

has_metadata name: "descMetadata", type: ActiveFedora::QualifiedDublinCoreDatastream
delegate :dc_type, to: "descMetadata"
after_initialize :add_dc_type

def add_dc_type
  datastreams["descMetadata"].field(:dc_type, :string, {path: "type", multiple: true})
end

jcoyne added a commit that referenced this pull request Jul 3, 2013
Added :path option to ActiveFedora::QualifiedDublinCoreDatastream#field ...
@jcoyne jcoyne merged commit c8f4777 into samvera:master Jul 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants