Class: ActiveFedora::Associations::Builder::HasAndBelongsToMany

Inherits:
CollectionAssociation show all
Defined in:
lib/active_fedora/associations/builder/has_and_belongs_to_many.rb

Overview

:nodoc:

Constant Summary

Constants inherited from CollectionAssociation

CollectionAssociation::CALLBACKS

Constants inherited from Association

Association::VALID_OPTIONS

Class Method Summary collapse

Methods inherited from CollectionAssociation

define_callback, define_callbacks, define_extensions, wrap_scope

Methods inherited from Association

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

Class Method Details

.macroObject



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

def self.macro
  :has_and_belongs_to_many
end

.valid_options(options) ⇒ Object



7
8
9
# File 'lib/active_fedora/associations/builder/has_and_belongs_to_many.rb', line 7

def self.valid_options(options)
  super + [:inverse_of, :solr_page_size]
end

.validate_options(options) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
# File 'lib/active_fedora/associations/builder/has_and_belongs_to_many.rb', line 11

def self.validate_options(options)
  super
  raise ArgumentError, "You must specify a predicate for #{name}" unless options[:predicate]
  raise ArgumentError, "Predicate must be a kind of RDF::URI" unless options[:predicate].is_a?(RDF::URI)
end