Sha256: eb3cc5d0e6803a4475e39cd5d126becbdaa96578b6aec0e7af131fd9829679cc

Contents?: true

Size: 866 Bytes

Versions: 16

Compression:

Stored size: 866 Bytes

Contents

require 'solrizer/field_name_mapper'

module ActiveFedora::MetadataDatastreamHelper 
  extend Deprecation
  self.deprecation_horizon = 'active-fedora 6.0'  

  attr_accessor :fields, :xml_loaded
  
  module ClassMethods
    
    #get the Class's field list
    def fields
      @@classFields
    end
    
  end
  
  def self.included(klass)
    klass.extend(ClassMethods)
    klass.send(:include, Solrizer::FieldNameMapper)
  end

  def ensure_xml_loaded
    return if xml_loaded 
    self.xml_loaded = true
    if new?
      ## Load up the template
      self.class.from_xml nil, self
    else
      self.class.from_xml content, self
    end
  end
  deprecation_deprecate :ensure_xml_loaded
  
  def serialize! # :nodoc:
    if changed?
      return unless xml_loaded or new?
      self.content = self.to_xml 
    end
  end
  deprecation_deprecate :serialize!

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
active-fedora-5.7.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.7.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.6.3 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.6.2 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.6.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.6.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.5.2 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.5.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.5.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.5.0.rc2 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.5.0.rc1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.4.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.3.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.3.0 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.2.1 lib/active_fedora/metadata_datastream_helper.rb
active-fedora-5.2.0 lib/active_fedora/metadata_datastream_helper.rb