Class: Hyrax::ValkyrieCanCanAdapter
- Inherits:
-
CanCan::ModelAdapters::AbstractAdapter
- Object
- CanCan::ModelAdapters::AbstractAdapter
- Hyrax::ValkyrieCanCanAdapter
- Defined in:
- lib/hyrax/valkyrie_can_can_adapter.rb
Overview
A ‘CanCan::ModelAdapter` for valkyrie resources
Class Method Summary collapse
Class Method Details
.find(_model_class, id) ⇒ Hyrax::Resource
21 22 23 24 25 26 |
# File 'lib/hyrax/valkyrie_can_can_adapter.rb', line 21 def self.find(_model_class, id) return Hyrax.query_service.find_by(id: id) unless Hyrax.config.enable_noids? Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: id) rescue Valkyrie::Persistence::ObjectNotFoundError => err raise Hyrax::ObjectNotFoundError, err. end |