Skip to content

Commit

Permalink
update the bulkrax factory to support flexible metadata while maintai…
Browse files Browse the repository at this point in the history
…ning non-flexi support
  • Loading branch information
orangewolf committed Dec 20, 2024
1 parent 44b471c commit 924f6b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/factories/bulkrax/valkyrie_object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self.field_multi_value?(field:, model:)
return false unless field_supported?(field: field, model: model)

if model.respond_to?(:schema)
dry_type = model.schema.key(field.to_sym)
dry_type = model.new.singleton_class.schema.key(field.to_sym)
return true if dry_type.respond_to?(:primitive) && dry_type.primitive == Array

false
Expand Down Expand Up @@ -193,7 +193,7 @@ def self.schema_properties(klass)
@schema_properties_map ||= {}

klass_key = klass.name
@schema_properties_map[klass_key] = klass.schema.map { |k| k.name.to_s } unless @schema_properties_map.key?(klass_key)
@schema_properties_map[klass_key] = klass.new.singleton_class.schema.map { |k| k.name.to_s } unless @schema_properties_map.key?(klass_key)

@schema_properties_map[klass_key]
end
Expand Down

0 comments on commit 924f6b8

Please sign in to comment.