Sha256: f4876e6e4f388cfad61d704bd559cb62afa279a2517a2920c74d7e6f42ee46e3

Contents?: true

Size: 442 Bytes

Versions: 10

Compression:

Stored size: 442 Bytes

Contents

# Fix the OAI gem resource identifier format
# See: https://github.com/code4lib/ruby-oai/issues/38

Rails.application.config.to_prepare do
  OAI::Provider::Response::RecordResponse.class_eval do
    private

    def identifier_for(record)
      "#{provider.prefix}:#{record.id}"
    end
  end

  OAI::Provider::Response::Base.class_eval do
    private

    def extract_identifier(id)
      id.sub("#{provider.prefix}:", '')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
blacklight_oai_provider-7.0.2 config/initializers/oai_patches.rb
blacklight_oai_provider-6.1.1 config/initializers/oai_patches.rb
blacklight_oai_provider-6.1.0 config/initializers/oai_patches.rb
blacklight_oai_provider-6.0.0 config/initializers/oai_patches.rb
blacklight_oai_provider-6.0.0.pre2 config/initializers/oai_patches.rb
blacklight_oai_provider-6.0.0.pre1 config/initializers/oai_patches.rb
blacklight_oai_provider-5.1.0 config/initializers/oai_patches.rb
blacklight_oai_provider-5.0.0 config/initializers/oai_patches.rb
blacklight_oai_provider-5.0.0.pre1 config/initializers/oai_patches.rb
blacklight_oai_provider-4.1.0 config/initializers/oai_patches.rb