Sha256: 7870ca35f52a01e5a06652c71e2b793a3d292b1a421e97dcf39173ea546cb2d3

Contents?: true

Size: 589 Bytes

Versions: 3

Compression:

Stored size: 589 Bytes

Contents

module ActiveFedora::Aggregation
  module BaseExtension

    ##
    # Create an aggregation association on the class
    # @example
    #   class Image < ActiveFedora::Base
    #     aggregates :generic_files
    #   end
    def aggregates(name, options={})
      Builder.build(self, name, options)
    end

    def create_reflection(macro, name, options, active_fedora)
      if macro == :aggregation
        Reflection.new(macro, name, options, active_fedora).tap do |reflection|
          add_reflection name, reflection
        end
      else
        super
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activefedora-aggregation-0.2.1 lib/active_fedora/aggregation/base_extension.rb
activefedora-aggregation-0.2.0 lib/active_fedora/aggregation/base_extension.rb
activefedora-aggregation-0.1.0 lib/active_fedora/aggregation/base_extension.rb