From 0d1e3c01944d1eb1e6fa456f7f16a1c9b5204ffd Mon Sep 17 00:00:00 2001 From: Ben Hoskings Date: Wed, 3 May 2017 21:25:47 +1000 Subject: [PATCH] Fix #to_list ext after squash -> compact change. --- lib/babushka/core_patches/array.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/babushka/core_patches/array.rb b/lib/babushka/core_patches/array.rb index 53c76ec07..b02c6a07d 100644 --- a/lib/babushka/core_patches/array.rb +++ b/lib/babushka/core_patches/array.rb @@ -151,7 +151,7 @@ def to_list(opts = {}) [ items[0..-2].compact.join(', '), items.last - ].compact.join("#{',' if opts[:oxford]} #{opts[:conj] || 'and'} ") + ].reject(&:blank?).join("#{',' if opts[:oxford]} #{opts[:conj] || 'and'} ") end # If the final element of the array is a +Hash+, it's removed from this array