Sha256: 637e3e88bca8722164769a5db46ffe0bb35a9d239d73817c8e252b8d48d7b324
Contents?: true
Size: 844 Bytes
Versions: 10
Compression:
Stored size: 844 Bytes
Contents
module CurationConcern module WithRelatedWorks extend ActiveSupport::Concern included do # Should use somethign like http://purl.org/dc/elements/1.1/relation # -- waiting for ability to modify AF predicates (which is in another branch right now). Using :has_member until then. has_and_belongs_to_many :related_works, property: :has_member, class_name:"ActiveFedora::Base" has_many :referenced_by_works, property: :has_member, class_name:"ActiveFedora::Base" #attr_accessible :related_work_tokens accepts_nested_attributes_for :related_works, :allow_destroy => true def related_work_tokens=(tokens) self.related_work_ids = CurationConcern::Work.ids_from_tokens(tokens) end def related_work_tokens self.related_work_ids.join(", ") end end end end
Version data entries
10 entries across 10 versions & 1 rubygems