Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
This tutorial assumes that you generated a work type name GenericWork. If you used a different name, substitute that name for all occurrences of GenericWork and generic_work. |
...
Code Block |
---|
# Generated via # `rails generate hyrax:work GenericWork` class GenericWork < ActiveFedora::Base include ::Hyrax::WorkBehavior include ::Hyrax::BasicMetadata # Change this to restrict which works can be added as a child. # self.valid_child_concerns = [] validates :title, presence: { message: 'Your work must have a title.' } property :contact_email, predicate: ::RDF::Vocab::VCARD.hasEmail, multiple: false do |index| index.as :stored_searchable end property :contact_phone, predicate: ::RDF::Vocab::VCARD.hasTelephone do |index| index.as :stored_searchable end property :department, predicate: ::RDF::URI.new("http://lib.my.edu/departments"), multiple: false do |index| index.as :stored_searchable, :facetable end end |
\uD83D\uDCCB Related articles
...