Sha256: ff53d5302ee707ff68ac81812b0ceeb6e53dca7b467fddd1f86dd8db701359d3

Contents?: true

Size: 540 Bytes

Versions: 58

Compression:

Stored size: 540 Bytes

Contents

module Hyrax
  # Provide the ActiveModel methods so that this object routes the same as the
  # object represented by the solr document.
  module ModelProxy
    delegate :to_param, :to_key, :id, to: :solr_document

    delegate :model_name, :valid_child_concerns, to: :_delegated_to

    def to_partial_path
      _delegated_to._to_partial_path
    end

    def persisted?
      true
    end

    def to_model
      self
    end

    private

      def _delegated_to
        @_delegated_to ||= solr_document.hydra_model
      end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 app/presenters/hyrax/model_proxy.rb
hyrax-2.9.5 app/presenters/hyrax/model_proxy.rb
hyrax-2.9.4 app/presenters/hyrax/model_proxy.rb
hyrax-2.9.3 app/presenters/hyrax/model_proxy.rb
hyrax-2.9.2 app/presenters/hyrax/model_proxy.rb
hyrax-2.9.1 app/presenters/hyrax/model_proxy.rb
hyrax-2.9.0 app/presenters/hyrax/model_proxy.rb
hyrax-2.8.0 app/presenters/hyrax/model_proxy.rb
hyrax-2.7.2 app/presenters/hyrax/model_proxy.rb
hyrax-2.7.1 app/presenters/hyrax/model_proxy.rb
hyrax-2.7.0 app/presenters/hyrax/model_proxy.rb
hyrax-2.6.0 app/presenters/hyrax/model_proxy.rb
hyrax-3.0.0.pre.rc1 app/presenters/hyrax/model_proxy.rb
hyrax-3.0.0.pre.beta3 app/presenters/hyrax/model_proxy.rb
hyrax-2.5.1 app/presenters/hyrax/model_proxy.rb
hyrax-2.5.0 app/presenters/hyrax/model_proxy.rb
hyrax-3.0.0.pre.beta2 app/presenters/hyrax/model_proxy.rb
hyrax-2.4.1 app/presenters/hyrax/model_proxy.rb
hyrax-3.0.0.pre.beta1 app/presenters/hyrax/model_proxy.rb
hyrax-2.4.0 app/presenters/hyrax/model_proxy.rb