Sha256: fbd86b5d4ae88801f8d0f2caceeb9575d60dc024fe75a64f191038d43895dc33
Contents?: true
Size: 961 Bytes
Versions: 33
Compression:
Stored size: 961 Bytes
Contents
module Hyrax module HumanReadableType extend ActiveSupport::Concern module ClassMethods def human_readable_type default = @_human_readable_type || name.demodulize.titleize I18n.translate("activefedora.models.#{model_name.i18n_key}", default: default) end def human_readable_type=(val) @_human_readable_type = val end deprecation_deprecate :human_readable_type= => 'human_readable_type is deprecated. ' \ 'Set the i18n key for activefedora.models.#{model_name.i18n_key} instead. ' \ 'This will be removed in Hyrax 3' end def human_readable_type self.class.human_readable_type end def to_solr(solr_doc = {}) super(solr_doc).tap do |doc| doc[Solrizer.solr_name('human_readable_type', :facetable)] = human_readable_type doc[Solrizer.solr_name('human_readable_type', :stored_searchable)] = human_readable_type end end end end
Version data entries
33 entries across 33 versions & 1 rubygems