Sha256: 9c0e05cf32e787a81dfeb583a212063838afa61c581998a443745f4b48794d78
Contents?: true
Size: 574 Bytes
Versions: 25
Compression:
Stored size: 574 Bytes
Contents
# frozen_string_literal: true module Hyrax module HumanReadableType extend ActiveSupport::Concern module ClassMethods def human_readable_type I18n.translate("activefedora.models.#{model_name.i18n_key}", default: name.demodulize.titleize) end end def human_readable_type self.class.human_readable_type end def to_solr(solr_doc = {}) super(solr_doc).tap do |doc| doc["human_readable_type_sim"] = human_readable_type doc["human_readable_type_tesim"] = human_readable_type end end end end
Version data entries
25 entries across 25 versions & 1 rubygems