Skip to content

Commit b12dc40

Browse files
committed
Simplify OAI-PMH initialization
1 parent 0d5a9ae commit b12dc40

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

config/initializers/oai_provider.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,5 @@ 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))
27-
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid, ActiveRecord::ConnectionNotEstablished
28-
Rails.logger.debug 'There is no database yet, so the OAI-PMH endpoint is not configured.'
26+
TrainingProvider.source_model OAI::Provider::ActiveRecordWrapper.new(Material.where(visible: true), identifier_field: 'id')
2927
end

0 commit comments

Comments
 (0)