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

Inherits:
CollectionAssociation show all
Extended by:
Deprecation
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, predicate, translate_property_to_predicate, valid_dependent_options, wrap_scope

Class Method Details

.macroObject



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

def self.macro
  :has_and_belongs_to_many
end

.valid_options(options) ⇒ Object



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

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

.validate_options(options) ⇒ Object

Raises:

  • (ArgumentError)


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

def self.validate_options(options)
  super
  Deprecation.warn HasAndBelongsToMany, ":solr_page_size doesn't do anything anymore and will be removed in ActiveFedora 10" if options.key?(:solr_page_size)
  raise "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