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,
sig/forest_admin_datasource_toolkit/schema/relations/many_to_many_schema.rbs

Instance Attribute Summary collapse

Attributes inherited from ForestAdminDatasourceToolkit::Schema::RelationSchema

#foreign_collection, #is_read_only, #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, foreign_type_field: nil, foreign_type_value: nil, is_read_only: false) ⇒ 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
27
28
29
30
31
# 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,
  foreign_type_field: nil,
  foreign_type_value: nil,
  is_read_only: false
)
  super(foreign_collection, 'ManyToMany', is_read_only: is_read_only)
  @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
  @foreign_type_field = foreign_type_field
  @foreign_type_value = foreign_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

#foreign_type_fieldObject

Returns the value of attribute foreign_type_field.



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

def foreign_type_field
  @foreign_type_field
end

#foreign_type_valueObject

Returns the value of attribute foreign_type_value.



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

def foreign_type_value
  @foreign_type_value
end

#origin_keyString

Returns the value of attribute origin_key.

Returns:

  • (String)


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_targetString

Returns the value of attribute origin_key_target.

Returns:

  • (String)


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_collectionString

Returns the value of attribute through_collection.

Returns:

  • (String)


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

def through_collection
  @through_collection
end