From e3cdfec8dac9f70ff2afa784390fce829f289c25 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 18 Jun 2024 11:45:17 -0700 Subject: [PATCH] Improved code [skip ci] --- lib/chartkick/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chartkick/helper.rb b/lib/chartkick/helper.rb index 9f16bec..fb7a25d 100644 --- a/lib/chartkick/helper.rb +++ b/lib/chartkick/helper.rb @@ -78,7 +78,7 @@ def chartkick_chart(klass, data_source, **options) # limit to alphanumeric and % for simplicity # this prevents things like calc() but safety is the priority # dot does not need escaped in square brackets - raise ArgumentError, "Invalid #{k}" unless html_vars[k] =~ /\A[a-zA-Z0-9%.]*\z/ + raise ArgumentError, "Invalid #{k}" unless /\A[a-zA-Z0-9%.]*\z/.match?(html_vars[k]) end html_vars.each_key do |k|