Sha256: 8fd937ae48490d7e1053594597537939afec022e93ee99b3606c7f654808d014

Contents?: true

Size: 551 Bytes

Versions: 32

Compression:

Stored size: 551 Bytes

Contents

module CurationConcerns
  # 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

32 entries across 32 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.7 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-2.0.0 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-2.0.0.rc2 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.6 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.5 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.4 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.3 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.2 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-2.0.0.rc1 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.1 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.0 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.7.0.beta1 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.6.3 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.6.2 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.6.1 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.6.0 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.5.0 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.4.0 app/presenters/curation_concerns/model_proxy.rb
curation_concerns-1.3.3 app/presenters/curation_concerns/model_proxy.rb