Module: ActiveFedora::Aggregation::BaseExtension

Defined in:
lib/active_fedora/aggregation/base_extension.rb

Instance Method Summary collapse

Instance Method Details

#aggregates(name, options = {}) ⇒ Object

Create an aggregation association on the class

Examples:

class Image < ActiveFedora::Base
  aggregates :generic_files
end


10
11
12
# File 'lib/active_fedora/aggregation/base_extension.rb', line 10

def aggregates(name, options={})
  Builder.build(self, name, options)
end

#create_reflection(macro, name, options, active_fedora) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/active_fedora/aggregation/base_extension.rb', line 14

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