Class: ForestAdminDatasourceToolkit::Schema::Relations::ManyToManySchema

Inherits:
ForestAdminDatasourceToolkit::Schema::RelationSchema show all
Defined in:
lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb

Instance Attribute Summary collapse

Attributes inherited from ForestAdminDatasourceToolkit::Schema::RelationSchema

#foreign_collection, #type

Instance Method Summary collapse

Constructor Details

#initialize(origin_key:, origin_key_target:, foreign_key:, foreign_key_target:, foreign_collection:, through_collection:, origin_type_field: nil, origin_type_value: nil) ⇒ ManyToManySchema

Returns a new instance of ManyToManySchema.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 8

def initialize(
  origin_key:,
  origin_key_target:,
  foreign_key:,
  foreign_key_target:,
  foreign_collection:,
  through_collection:,
  origin_type_field: nil,
  origin_type_value: nil
)
  super(foreign_collection, 'ManyToMany')
  @origin_key = origin_key
  @origin_key_target = origin_key_target
  @through_collection = through_collection
  @foreign_key = foreign_key
  @foreign_key_target = foreign_key_target
  @origin_type_field = origin_type_field
  @origin_type_value = origin_type_value
end

Instance Attribute Details

#foreign_keyObject

Returns the value of attribute foreign_key.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def foreign_key
  @foreign_key
end

#foreign_key_targetObject

Returns the value of attribute foreign_key_target.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def foreign_key_target
  @foreign_key_target
end

#origin_keyObject

Returns the value of attribute origin_key.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def origin_key
  @origin_key
end

#origin_key_targetObject

Returns the value of attribute origin_key_target.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def origin_key_target
  @origin_key_target
end

#origin_type_fieldObject

Returns the value of attribute origin_type_field.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def origin_type_field
  @origin_type_field
end

#origin_type_valueObject

Returns the value of attribute origin_type_value.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def origin_type_value
  @origin_type_value
end

#through_collectionObject

Returns the value of attribute through_collection.



5
6
7
# File 'lib/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rb', line 5

def through_collection
  @through_collection
end