Sha256: e852c5a75487164609654a8e2b94b2b68d4922ccd5f8212b98e7171737021453

Contents?: true

Size: 738 Bytes

Versions: 29

Compression:

Stored size: 738 Bytes

Contents

module CurationConcerns
  # This stands in for ActiveFedora::CleanConnection. It behaves the same way,
  # but it doesn't clear the has_model assertion
  class CleanConnection < SimpleDelegator
    def get(*args)
      result = __getobj__.get(*args) do |req|
        prefer_headers = Ldp::PreferHeaders.new(req.headers["Prefer"])
        prefer_headers.omit = prefer_headers.omit | omit_uris
        req.headers["Prefer"] = prefer_headers.to_s
      end
      result
    end

    private

      def omit_uris
        [
          ::RDF::Vocab::Fcrepo4.ServerManaged,
          ::RDF::Vocab::LDP.PreferContainment,
          ::RDF::Vocab::LDP.PreferEmptyContainer,
          ::RDF::Vocab::LDP.PreferMembership
        ]
      end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
curation_concerns-1.3.2 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.3.1 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.3.0 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.2.0 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.1.2 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.1.1 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.1.0 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.0.0 app/connections/curation_concerns/clean_connection.rb
curation_concerns-1.0.0.beta10 app/connections/curation_concerns/clean_connection.rb