Class: CommonRepositoryModel::PersistenceBase

Inherits:
ActiveFedora::Base
  • Object
show all
Includes:
ActiveModel::SerializerSupport
Defined in:
lib/common_repository_model/persistence_base.rb

Direct Known Subclasses

Area, Collection, Data

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find(*args, &block) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/common_repository_model/persistence_base.rb', line 12

def self.find(*args,&block)
  super
rescue RSolr::Error::Http => e
  raise CommonRepositoryModel::ObjectNotFoundError.new(
    "#{self}.find(#{args.inspect}) had a SOLR error.", e
  )
rescue ActiveFedora::ObjectNotFoundError => e
  raise CommonRepositoryModel::ObjectNotFoundError.new(e.message, e)
end

Instance Method Details

#active_model_serializerObject



8
9
10
# File 'lib/common_repository_model/persistence_base.rb', line 8

def active_model_serializer
  "#{self.class}Serializer".constantize
end