Sha256: 6fbb37ad2686921b3a4e32ab6310c84608ebe96e60d06e5eb953a523f040c6b6

Contents?: true

Size: 1.58 KB

Versions: 11

Compression:

Stored size: 1.58 KB

Contents

SOLR_DOCUMENT_ID = "id" unless (defined?(SOLR_DOCUMENT_ID) && !SOLR_DOCUMENT_ID.nil?)
ENABLE_SOLR_UPDATES = true unless defined?(ENABLE_SOLR_UPDATES)
require 'active_support/descendants_tracker'
require 'active_fedora/errors'

module ActiveFedora

  # This class ties together many of the lower-level modules, and
  # implements something akin to an ActiveRecord-alike interface to
  # fedora. If you want to represent a fedora object in the ruby
  # space, this is the class you want to extend.
  #
  # =The Basics
  #   class Oralhistory < ActiveFedora::Base
  #     has_metadata "properties", type: ActiveFedora::SimpleDatastream do |m|
  #       m.field "narrator",  :string
  #       m.field "narrator",  :text
  #     end
  #   end
  #
  # The above example creates a Fedora object with a metadata datastream named "properties", which is composed of a
  # narrator and bio field.
  #
  # Attached files defined with +contains+ are accessed via the +attached_files+ member hash.
  #
  class Base
    extend ActiveModel::Naming
    extend ActiveSupport::DescendantsTracker

    include Core
    include Persistence
    include Indexing
    include Scoping
    include ActiveModel::Conversion
    include Callbacks
    include Validations
    extend Querying
    include Associations
    include AutosaveAssociation
    include NestedAttributes
    include Reflection
    include Serialization

    include AttachedFiles
    include FedoraAttributes
    include AttributeMethods
    include Attributes
    include Versionable
    include LoadableFromJson
  end

  ActiveSupport.run_load_hooks(:active_fedora, Base)
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
active-fedora-9.0.0.rc3 lib/active_fedora/base.rb
active-fedora-9.0.0.rc2 lib/active_fedora/base.rb
active-fedora-9.0.0.rc1 lib/active_fedora/base.rb
active-fedora-9.0.0.beta8 lib/active_fedora/base.rb
active-fedora-9.0.0.beta7 lib/active_fedora/base.rb
active-fedora-9.0.0.beta6 lib/active_fedora/base.rb
active-fedora-9.0.0.beta5 lib/active_fedora/base.rb
active-fedora-9.0.0.beta4 lib/active_fedora/base.rb
active-fedora-9.0.0.beta3 lib/active_fedora/base.rb
active-fedora-9.0.0.beta2 lib/active_fedora/base.rb
active-fedora-9.0.0.beta1 lib/active_fedora/base.rb