lib/search_flip/response.rb in search_flip-4.0.0.beta13 vs lib/search_flip/response.rb in search_flip-4.0.0.beta14
- old
+ new
@@ -221,10 +221,10 @@
#
# @return [Array] An array of database records
def records
@records ||= begin
- sort_map = ids.each_with_index.each_with_object({}) { |(id, index), hash| hash[id.to_s] = index }
+ sort_map = ids.each_with_index.with_object({}) { |(id, index), hash| hash[id.to_s] = index }
scope.to_a.sort_by { |record| sort_map[criteria.target.record_id(record).to_s] }
end
end