Class: ActiveFedora::Associations::Builder::Aggregation

Inherits:
Association
  • Object
show all
Defined in:
lib/active_fedora/associations/builder/aggregation.rb

Constant Summary

Constants inherited from Association

ActiveFedora::Associations::Builder::Association::VALID_OPTIONS

Class Method Summary collapse

Methods inherited from Association

add_destroy_callbacks, better_name, build_scope, check_dependent_options, create_reflection, define_accessors, define_callbacks, define_extensions, define_readers, define_validations, define_writers, macro, valid_dependent_options, validate_options, wrap_scope

Class Method Details

.build(model, name, options) ⇒ Object



7
8
9
10
11
# File 'lib/active_fedora/associations/builder/aggregation.rb', line 7

def self.build(model, name, options)
  model.indirectly_contains name, { has_member_relation: has_member_relation(options), through: proxy_class, foreign_key: proxy_foreign_key, inserted_content_relation: inserted_content_relation }.merge(indirect_options(options))
  model.has_subresource contains_key(options), class_name: list_source_class
  model.orders name, through: contains_key(options)
end

.valid_options(_options) ⇒ Object



3
4
5
# File 'lib/active_fedora/associations/builder/aggregation.rb', line 3

def self.valid_options(_options)
  [:through, :class_name, :has_member_relation, :type_validator]
end