Skip to content

Commit 8653301

Browse files
committed
More general error catching during OAI-PMH config
1 parent b12dc40 commit 8653301

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

config/initializers/oai_provider.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ class TrainingProvider < OAI::Provider::Base
2323
end
2424

2525
Rails.application.config.after_initialize do
26-
TrainingProvider.source_model OAI::Provider::ActiveRecordWrapper.new(Material.where(visible: true), identifier_field: 'id')
26+
TrainingProvider.source_model OAI::Provider::ActiveRecordWrapper.new(Material.where(visible: true))
27+
rescue ActiveRecord::ActiveRecordError
28+
Rails.logger.debug 'There is no database yet or some other error, so the OAI-PMH endpoint is not configured.'
2729
end

0 commit comments

Comments
 (0)