Class: ROM::Associations::ManyToMany

Inherits:
Abstract
  • Object
show all
Defined in:
core/lib/rom/associations/many_to_many.rb

Overview

Abstract many-to-many association type

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#join_relationObject (readonly)



14
15
16
# File 'core/lib/rom/associations/many_to_many.rb', line 14

def join_relation
  @join_relation
end

Instance Method Details

#callObject

This method is abstract.

Adapters should implement this method

Raises:

  • (NotImplementedError)


28
29
30
# File 'core/lib/rom/associations/many_to_many.rb', line 28

def call(*)
  raise NotImplementedError
end

#foreign_keySymbol

Return configured or inferred FK name

Returns:

  • (Symbol)


37
38
39
# File 'core/lib/rom/associations/many_to_many.rb', line 37

def foreign_key
  definition.foreign_key || join_relation.foreign_key(source.name)
end

#throughSymbol

Return join-relation name

Returns:

  • (Symbol)


46
47
48
# File 'core/lib/rom/associations/many_to_many.rb', line 46

def through
  definition.through
end