Skip to content

Commit

Permalink
Merge branch 'main' into bootstrap_card_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Dec 20, 2024
2 parents 45193c0 + 76023a9 commit 316fc07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/factories/bulkrax/object_factory_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ def delete(_user)
#
# @return [Object] when we've found the object by the entry's :id or by it's
# source_identifier
# @return [FalseClass] when we cannot find the object.
# @return [NilClass] when we cannot find the object.
def find
find_by_id || search_by_identifier || false
find_by_id || search_by_identifier || nil
end

##
Expand Down
6 changes: 4 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,8 @@ 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)
schema = model.new.singleton_class.schema || model.schema
dry_type = schema.key(field.to_sym)
return true if dry_type.respond_to?(:primitive) && dry_type.primitive == Array

false
Expand Down Expand Up @@ -193,7 +194,8 @@ 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 = klass.new.singleton_class.schema || klass.schema
@schema_properties_map[klass_key] = schema.map { |k| k.name.to_s } unless @schema_properties_map.key?(klass_key)

@schema_properties_map[klass_key]
end
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/export_work_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def perform(*args)
end
# rubocop:enable Rails/SkipsModelValidations
end
return entry if exporter_run.enqueued_records.positive?
return entry if exporter_run.reload.enqueued_records.positive?

if exporter_run.failed_records.positive?
exporter_run.exporter.set_status_info('Complete (with failures)')
Expand Down

0 comments on commit 316fc07

Please sign in to comment.