lib/gmaps4rails/extensions/array.rb in gmaps4rails-1.4.0 vs lib/gmaps4rails/extensions/array.rb in gmaps4rails-1.4.1

- old
+ new

@@ -3,10 +3,11 @@ #this method enables short call to the json creation for all elements in the array def to_gmaps4rails(&block) output = "[" json_array = [] each do |object| - json_array << Gmaps4rails.create_json(object, &block).to_s + json = Gmaps4rails.create_json(object, &block) + json_array << json.to_s unless json.nil? end output << json_array * (",") output << "]" end end \ No newline at end of file