Sha256: 95100eafa70ace9891ffbb4a04246a60287c94134c095911f6c7c0f9b86c69f6

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

require "transformator/transformation/step"
require_relative "../result_transformation"

class Skala::PrimoAdapter::Search::ResultTransformation::
  SortTermsFacetsTerms < Transformator::Transformation::Step

  def call
    target.facets.each do |_target_facet|
      if _target_facet.type.to_s == "terms"
        _target_facet.terms.sort_by!(&:count).reverse!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/primo_adapter/search/result_transformation/sort_terms_facets_terms.rb