Sha256: 21acb6b68dfef66e2c6adc649899fa8b5d0c633a123e5f31f79ba804d9e86141
Contents?: true
Size: 576 Bytes
Versions: 55
Compression:
Stored size: 576 Bytes
Contents
module Para module SearchHelper def fulltext_search_param_for(attributes) "#{ searchable_attributes(attributes) }_cont" end def filtered?(attributes) params[:q] && params[:q][fulltext_search_param_for(attributes)].present? end def searchable_attributes(attributes) whitelist = attributes.select(&:searchable?) whitelist.map do |attribute| attribute.attribute_column_path.join('_') end.join('_or_') end def distinct_search_results(search) Para::Search::Distinct.new(search).result end end end
Version data entries
55 entries across 55 versions & 1 rubygems