Sha256: 15768a0ed6376ddc1f788f3d2616e1b8641bc50c02055ce2ef75976cbf072435

Contents?: true

Size: 492 Bytes

Versions: 62

Compression:

Stored size: 492 Bytes

Contents

module CurationConcerns
  module HumanReadableType
    extend ActiveSupport::Concern

    included do
      class_attribute :human_readable_type
      self.human_readable_type = name.demodulize.titleize
    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

62 entries across 62 versions & 2 rubygems

Version Path
curation_concerns-1.3.2 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.3.1 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.3.0 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.2.0 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.1.2 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.1.1 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.1.0 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta10 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta9 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta8 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta7 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta6 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta5 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta4 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta3 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta2 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-1.0.0.beta1 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-0.14.0 app/models/concerns/curation_concerns/human_readable_type.rb
curation_concerns-0.14.0.pre4 app/models/concerns/curation_concerns/human_readable_type.rb