Module: Hyrax::ModelProxy

Included in:
CollectionPresenter, EmbargoPresenter, FileSetPresenter, LeasePresenter, TrophyPresenter, WorkShowPresenter
Defined in:
app/presenters/hyrax/model_proxy.rb

Overview

Provide the ActiveModel methods so that this object routes the same as the object represented by the solr document.

Instance Method Summary collapse

Instance Method Details

#persisted?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/presenters/hyrax/model_proxy.rb', line 9

def persisted?
  true
end

#to_modelObject



13
14
15
# File 'app/presenters/hyrax/model_proxy.rb', line 13

def to_model
  self
end

#valid_child_concernsObject

Deprecated.

this isn’t related to the ModelProxy issue, and has been moved to ‘WorkShowPresenter`.



20
21
22
23
# File 'app/presenters/hyrax/model_proxy.rb', line 20

def valid_child_concerns
  Deprecation.warn "#{self.class}#valid_child_concerns will be removed in Hyrax 4.0."
  Hyrax::ChildTypes.for(parent: solr_document.hydra_model)
end