lib/agnostic_backend/cloudsearch/indexer.rb in agnostic_backend-0.9.8 vs lib/agnostic_backend/cloudsearch/indexer.rb in agnostic_backend-0.9.9
- old
+ new
@@ -63,9 +63,11 @@
def date_format(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 add_metadata_to(document)