lib/agnostic_backend/elasticsearch/indexer.rb in agnostic_backend-0.9.8 vs lib/agnostic_backend/elasticsearch/indexer.rb in agnostic_backend-0.9.9
- old
+ new
@@ -43,9 +43,11 @@
def format_dates_in(document)
document.each do |k, v|
if v.is_a?(Time)
document[k] = v.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
+ elsif v.is_a?(Array) && v.all?{|e| e.is_a?(Time)}
+ document[k] = v.map{|e| e.utc.strftime("%Y-%m-%dT%H:%M:%SZ")}
end
end
end
def convert_to_bulk_upload_string(documents)