lib/elastic_engine/search/params.rb
# Run the limit param through a validation process
# Fall back to defaults if nothing applies
#
Run the limit param through a validation process
Fall back to defaults if nothing applies
Run the limit param through a validation process Fall back to defaults if nothing applies
def validate_limit_param(limit)
        return limit unless search.facet_klass.respond_to?(:available_limits)
        if search.facet_klass.limits_for_form.include?(limit.to_i)
          limit.to_i
        else
          _default_ = search.facet_klass.available_limits.select{|x| x.fetch(:default, false) }.first
          _default_ = search.facet_klass.available_limits.first unless _default_
          _default_.fetch(:value, nil)
        end
      rescue
        nil
      end
def validate_limit_param ( limit ) return limit unless search . facet_klass . respond_to? ( :available_limits ) if search . facet_klass . limits_for_form . include? ( limit . to_i ) limit . to_i else _default_ = search . facet_klass . available_limits . select { | x | x . fetch ( :default , false ) } . first _default_ = search . facet_klass . available_limits . first unless _default_ _default_ . fetch ( :value , nil ) end rescue nil end
Run the limit param through a validation process
Fall back to defaults if nothing applies
Run the limit param through a validation process Fall back to defaults if nothing applies
# Just give the limit of the request if there is no facet_klass # If default does not exist, select the first
limit
<not_specific>