Class: ForestAdminDatasourceToolkit::Schema::Relations::PolymorphicOneToManySchema

Inherits:
ForestAdminDatasourceToolkit::Schema::RelationSchema show all
Defined in:
lib/forest_admin_datasource_toolkit/schema/relations/polymorphic_one_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_collection:, origin_type_field:, origin_type_value:) ⇒ PolymorphicOneToManySchema

Returns a new instance of PolymorphicOneToManySchema.



8
9
10
11
12
13
14
# File 'lib/forest_admin_datasource_toolkit/schema/relations/polymorphic_one_to_many_schema.rb', line 8

def initialize(origin_key:, origin_key_target:, foreign_collection:, origin_type_field:, origin_type_value:)
  super(foreign_collection, 'PolymorphicOneToMany')
  @origin_key = origin_key
  @origin_key_target = origin_key_target
  @origin_type_field = origin_type_field
  @origin_type_value = origin_type_value
end

Instance Attribute Details

#origin_keyObject

Returns the value of attribute origin_key.



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

def origin_key
  @origin_key
end

#origin_key_targetObject (readonly)

Returns the value of attribute origin_key_target.



6
7
8
# File 'lib/forest_admin_datasource_toolkit/schema/relations/polymorphic_one_to_many_schema.rb', line 6

def origin_key_target
  @origin_key_target
end

#origin_type_fieldObject (readonly)

Returns the value of attribute origin_type_field.



6
7
8
# File 'lib/forest_admin_datasource_toolkit/schema/relations/polymorphic_one_to_many_schema.rb', line 6

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/polymorphic_one_to_many_schema.rb', line 5

def origin_type_value
  @origin_type_value
end