lib/endeca/document_collection.rb in primedia-endeca-0.9.13 vs lib/endeca/document_collection.rb in primedia-endeca-0.9.14
- old
+ new
@@ -59,10 +59,10 @@
# The internal collection of Document objects. Array methods are delegated here.
def documents
if @raw['Records']
@documents ||= @raw['Records'].map(&@document_klass)
- elsif @raw['AggrRecords']
+ elsif aggregate?
@documents ||= @raw['AggrRecords'].map{|aggregate| aggregate['Records'].first}.map(&@document_klass)
else
[]
end
end