lib/pose/search.rb in pose-3.1.1 vs lib/pose/search.rb in pose-3.2.0

- old
+ new

@@ -8,10 +8,11 @@ # @param [Array<Class>] classes The classes to search over. # @param [String] query_string The full-text part of the search query. # @param options Additional search options: # * where: additional where clauses # * join: additional join clauses + # * select: custom select clause def initialize classes, query_string, options = {} @query = Query.new classes, query_string, options end @@ -66,9 +67,12 @@ def load_classes result return if @query.ids_requested? result.each do |clazz, ids| if ids.size > 0 result[clazz] = clazz.where(id: ids) + if @query.has_select + result[clazz] = result[clazz].select(@query.options[:select]) + end end end end