Class: ForestAdminDatasourceToolkit::Schema::Relations::PolymorphicManyToOneSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/forest_admin_datasource_toolkit/schema/relations/polymorphic_many_to_one_schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(foreign_key_type_field:, foreign_key:, foreign_key_targets:, foreign_collections:) ⇒ PolymorphicManyToOneSchema

Returns a new instance of PolymorphicManyToOneSchema.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/forest_admin_datasource_toolkit/schema/relations/polymorphic_many_to_one_schema.rb', line 8

def initialize(
  foreign_key_type_field:,
  foreign_key:,
  foreign_key_targets:,
  foreign_collections:
)
  @foreign_key = foreign_key
  @foreign_key_targets = foreign_key_targets
  @foreign_key_type_field = foreign_key_type_field
  @foreign_collections = foreign_collections
  @type = 'PolymorphicManyToOne'
end

Instance Attribute Details

#foreign_collectionsObject (readonly)

Returns the value of attribute foreign_collections.



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

def foreign_collections
  @foreign_collections
end

#foreign_keyObject (readonly)

Returns the value of attribute foreign_key.



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

def foreign_key
  @foreign_key
end

#foreign_key_targetObject (readonly)

Returns the value of attribute foreign_key_target.



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

def foreign_key_target
  @foreign_key_target
end

#foreign_key_targetsObject (readonly)

Returns the value of attribute foreign_key_targets.



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

def foreign_key_targets
  @foreign_key_targets
end

#foreign_key_type_fieldObject (readonly)

Returns the value of attribute foreign_key_type_field.



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

def foreign_key_type_field
  @foreign_key_type_field
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end